{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "-"
    }
   },
   "source": [
    "# 注意力汇聚：Nadaraya-Watson 核回归\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "sys.path.append('..')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "origin_pos": 2,
    "tab": [
     "pytorch"
    ]
   },
   "outputs": [],
   "source": [
    "from d2l import mindspore as d2l\n",
    "import mindspore\n",
    "from mindspore import nn, Parameter, value_and_grad"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "生成数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "origin_pos": 9,
    "tab": [
     "pytorch"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "50"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "n_train = 50  # 训练样本数\n",
    "x_train, _ = d2l.sort(d2l.rand(n_train) * 5)   # 排序后的训练样本\n",
    "\n",
    "def f(x):\n",
    "    return 2 * d2l.sin(x) + x**0.8\n",
    "\n",
    "y_train = f(x_train) + d2l.normal((n_train,), 0.0, 0.5)  # 训练样本的输出\n",
    "x_test = d2l.arange(0, 5, 0.1)  # 测试样本\n",
    "y_truth = f(x_test)  # 测试样本的真实输出\n",
    "n_test = len(x_test)  # 测试样本数\n",
    "n_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "origin_pos": 15,
    "tab": [
     "pytorch"
    ]
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"184.455469pt\" version=\"1.1\" viewBox=\"0 0 248.301563 184.455469\" width=\"248.301563pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-11-24T11:13:04.533472</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.3, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 184.455469 \n",
       "L 248.301563 184.455469 \n",
       "L 248.301563 -0 \n",
       "L 0 -0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 42.620312 146.899219 \n",
       "L 237.920313 146.899219 \n",
       "L 237.920313 10.999219 \n",
       "L 42.620312 10.999219 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 42.620312 146.899219 \n",
       "L 42.620312 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"m4e35fe814d\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m4e35fe814d\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(39.439062 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 81.680312 146.899219 \n",
       "L 81.680312 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"81.680312\" xlink:href=\"#m4e35fe814d\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(78.499062 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 120.740313 146.899219 \n",
       "L 120.740313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"120.740313\" xlink:href=\"#m4e35fe814d\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(117.559062 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 159.800313 146.899219 \n",
       "L 159.800313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"159.800313\" xlink:href=\"#m4e35fe814d\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(156.619063 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 198.860313 146.899219 \n",
       "L 198.860313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"198.860313\" xlink:href=\"#m4e35fe814d\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(195.679063 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 237.920313 146.899219 \n",
       "L 237.920313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"237.920313\" xlink:href=\"#m4e35fe814d\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 5 -->\n",
       "      <g transform=\"translate(234.739063 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_7\">\n",
       "     <!-- x -->\n",
       "     <g transform=\"translate(137.310937 175.175781)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 3513 3500 \n",
       "L 2247 1797 \n",
       "L 3578 0 \n",
       "L 2900 0 \n",
       "L 1881 1375 \n",
       "L 863 0 \n",
       "L 184 0 \n",
       "L 1544 1831 \n",
       "L 300 3500 \n",
       "L 978 3500 \n",
       "L 1906 2253 \n",
       "L 2834 3500 \n",
       "L 3513 3500 \n",
       "z\n",
       "\" id=\"DejaVuSans-78\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-78\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 42.620312 146.899219 \n",
       "L 237.920313 146.899219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"me5f1f707c9\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#me5f1f707c9\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- −1 -->\n",
       "      <g transform=\"translate(20.878125 150.698437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 678 2272 \n",
       "L 4684 2272 \n",
       "L 4684 1741 \n",
       "L 678 1741 \n",
       "L 678 2272 \n",
       "z\n",
       "\" id=\"DejaVuSans-2212\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-2212\"/>\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 42.620312 124.249219 \n",
       "L 237.920313 124.249219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#me5f1f707c9\" y=\"124.249219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(29.257812 128.048437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 42.620312 101.599219 \n",
       "L 237.920313 101.599219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_18\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#me5f1f707c9\" y=\"101.599219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(29.257812 105.398437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 42.620312 78.949219 \n",
       "L 237.920313 78.949219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_20\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#me5f1f707c9\" y=\"78.949219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(29.257812 82.748437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_21\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 42.620312 56.299219 \n",
       "L 237.920313 56.299219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_22\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#me5f1f707c9\" y=\"56.299219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(29.257812 60.098437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_23\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 42.620312 33.649219 \n",
       "L 237.920313 33.649219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_24\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#me5f1f707c9\" y=\"33.649219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(29.257812 37.448437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_25\">\n",
       "      <path clip-path=\"url(#p975401a699)\" d=\"M 42.620312 10.999219 \n",
       "L 237.920313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_26\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#me5f1f707c9\" y=\"10.999219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 5 -->\n",
       "      <g transform=\"translate(29.257812 14.798437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_15\">\n",
       "     <!-- y -->\n",
       "     <g transform=\"translate(14.798437 81.908594)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 2059 -325 \n",
       "Q 1816 -950 1584 -1140 \n",
       "Q 1353 -1331 966 -1331 \n",
       "L 506 -1331 \n",
       "L 506 -850 \n",
       "L 844 -850 \n",
       "Q 1081 -850 1212 -737 \n",
       "Q 1344 -625 1503 -206 \n",
       "L 1606 56 \n",
       "L 191 3500 \n",
       "L 800 3500 \n",
       "L 1894 763 \n",
       "L 2988 3500 \n",
       "L 3597 3500 \n",
       "L 2059 -325 \n",
       "z\n",
       "\" id=\"DejaVuSans-79\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-79\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_27\">\n",
       "    <path clip-path=\"url(#p975401a699)\" d=\"M 42.620312 124.249219 \n",
       "L 46.526313 116.136982 \n",
       "L 50.432313 108.999323 \n",
       "L 54.338313 102.217148 \n",
       "L 58.244313 95.726382 \n",
       "L 62.150312 89.522233 \n",
       "L 66.056313 83.61909 \n",
       "L 69.962312 78.038824 \n",
       "L 73.868313 72.805995 \n",
       "L 77.774314 67.9454 \n",
       "L 81.680312 63.480584 \n",
       "L 85.586313 59.432954 \n",
       "L 89.492314 55.821098 \n",
       "L 93.398315 52.660253 \n",
       "L 97.304312 49.962036 \n",
       "L 101.210313 47.734078 \n",
       "L 105.116313 45.979916 \n",
       "L 109.022314 44.698804 \n",
       "L 112.928315 43.885737 \n",
       "L 116.834312 43.531366 \n",
       "L 120.740313 43.6221 \n",
       "L 124.646318 44.140188 \n",
       "L 128.552314 45.063862 \n",
       "L 132.458311 46.367563 \n",
       "L 136.364316 48.022135 \n",
       "L 140.270312 49.995102 \n",
       "L 144.176318 52.251038 \n",
       "L 148.082314 54.751808 \n",
       "L 151.988311 57.457028 \n",
       "L 155.894316 60.324422 \n",
       "L 159.800313 63.310198 \n",
       "L 163.706318 66.369546 \n",
       "L 167.612314 69.457035 \n",
       "L 171.518311 72.527086 \n",
       "L 175.424316 75.534393 \n",
       "L 179.330312 78.434376 \n",
       "L 183.236318 81.183649 \n",
       "L 187.142314 83.740421 \n",
       "L 191.048311 86.06491 \n",
       "L 194.954316 88.119776 \n",
       "L 198.860313 89.870418 \n",
       "L 202.766309 91.285373 \n",
       "L 206.672324 92.336626 \n",
       "L 210.57832 92.999866 \n",
       "L 214.484316 93.254724 \n",
       "L 218.390312 93.084991 \n",
       "L 222.296309 92.478762 \n",
       "L 226.202324 91.428564 \n",
       "L 230.10832 89.931456 \n",
       "L 234.014316 87.988968 \n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_28\">\n",
       "    <path clip-path=\"url(#p975401a699)\" d=\"M 42.620312 69.386076 \n",
       "L 46.526313 69.386076 \n",
       "L 50.432313 69.386076 \n",
       "L 54.338313 69.386076 \n",
       "L 58.244313 69.386076 \n",
       "L 62.150312 69.386076 \n",
       "L 66.056313 69.386076 \n",
       "L 69.962312 69.386076 \n",
       "L 73.868313 69.386076 \n",
       "L 77.774314 69.386076 \n",
       "L 81.680312 69.386076 \n",
       "L 85.586313 69.386076 \n",
       "L 89.492314 69.386076 \n",
       "L 93.398315 69.386076 \n",
       "L 97.304312 69.386076 \n",
       "L 101.210313 69.386076 \n",
       "L 105.116313 69.386076 \n",
       "L 109.022314 69.386076 \n",
       "L 112.928315 69.386076 \n",
       "L 116.834312 69.386076 \n",
       "L 120.740313 69.386076 \n",
       "L 124.646318 69.386076 \n",
       "L 128.552314 69.386076 \n",
       "L 132.458311 69.386076 \n",
       "L 136.364316 69.386076 \n",
       "L 140.270312 69.386076 \n",
       "L 144.176318 69.386076 \n",
       "L 148.082314 69.386076 \n",
       "L 151.988311 69.386076 \n",
       "L 155.894316 69.386076 \n",
       "L 159.800313 69.386076 \n",
       "L 163.706318 69.386076 \n",
       "L 167.612314 69.386076 \n",
       "L 171.518311 69.386076 \n",
       "L 175.424316 69.386076 \n",
       "L 179.330312 69.386076 \n",
       "L 183.236318 69.386076 \n",
       "L 187.142314 69.386076 \n",
       "L 191.048311 69.386076 \n",
       "L 194.954316 69.386076 \n",
       "L 198.860313 69.386076 \n",
       "L 202.766309 69.386076 \n",
       "L 206.672324 69.386076 \n",
       "L 210.57832 69.386076 \n",
       "L 214.484316 69.386076 \n",
       "L 218.390312 69.386076 \n",
       "L 222.296309 69.386076 \n",
       "L 226.202324 69.386076 \n",
       "L 230.10832 69.386076 \n",
       "L 234.014316 69.386076 \n",
       "\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_29\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 3 \n",
       "C 0.795609 3 1.55874 2.683901 2.12132 2.12132 \n",
       "C 2.683901 1.55874 3 0.795609 3 0 \n",
       "C 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \n",
       "C 1.55874 -2.683901 0.795609 -3 0 -3 \n",
       "C -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \n",
       "C -2.683901 -1.55874 -3 -0.795609 -3 0 \n",
       "C -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \n",
       "C -1.55874 2.683901 -0.795609 3 0 3 \n",
       "z\n",
       "\" id=\"mf9d7d94160\" style=\"stroke:#ff7f0e;stroke-opacity:0.5;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p975401a699)\">\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"46.200385\" xlink:href=\"#mf9d7d94160\" y=\"132.583698\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"47.924768\" xlink:href=\"#mf9d7d94160\" y=\"113.325927\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"50.623843\" xlink:href=\"#mf9d7d94160\" y=\"117.179436\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"52.458427\" xlink:href=\"#mf9d7d94160\" y=\"88.557466\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"64.520449\" xlink:href=\"#mf9d7d94160\" y=\"100.786084\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"73.26929\" xlink:href=\"#mf9d7d94160\" y=\"57.854444\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"82.916341\" xlink:href=\"#mf9d7d94160\" y=\"70.948343\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"85.728853\" xlink:href=\"#mf9d7d94160\" y=\"60.691477\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"96.96157\" xlink:href=\"#mf9d7d94160\" y=\"45.889798\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"102.040585\" xlink:href=\"#mf9d7d94160\" y=\"47.581286\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"102.522308\" xlink:href=\"#mf9d7d94160\" y=\"40.568492\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"108.279087\" xlink:href=\"#mf9d7d94160\" y=\"33.989441\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"115.219381\" xlink:href=\"#mf9d7d94160\" y=\"23.368117\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"115.403496\" xlink:href=\"#mf9d7d94160\" y=\"35.860452\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"116.265044\" xlink:href=\"#mf9d7d94160\" y=\"59.176532\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"117.878802\" xlink:href=\"#mf9d7d94160\" y=\"58.52277\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"117.950756\" xlink:href=\"#mf9d7d94160\" y=\"61.61007\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"121.239833\" xlink:href=\"#mf9d7d94160\" y=\"42.719978\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"122.097768\" xlink:href=\"#mf9d7d94160\" y=\"37.86042\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"123.054911\" xlink:href=\"#mf9d7d94160\" y=\"51.738939\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"131.102122\" xlink:href=\"#mf9d7d94160\" y=\"58.714363\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"134.89429\" xlink:href=\"#mf9d7d94160\" y=\"28.899414\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"136.853732\" xlink:href=\"#mf9d7d94160\" y=\"37.786524\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"139.789175\" xlink:href=\"#mf9d7d94160\" y=\"42.523222\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"140.606377\" xlink:href=\"#mf9d7d94160\" y=\"46.500072\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"143.549103\" xlink:href=\"#mf9d7d94160\" y=\"55.042138\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"145.754241\" xlink:href=\"#mf9d7d94160\" y=\"55.526777\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"149.165103\" xlink:href=\"#mf9d7d94160\" y=\"62.679365\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"152.964367\" xlink:href=\"#mf9d7d94160\" y=\"58.149683\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"154.910036\" xlink:href=\"#mf9d7d94160\" y=\"70.294111\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"157.887834\" xlink:href=\"#mf9d7d94160\" y=\"74.553083\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"158.961533\" xlink:href=\"#mf9d7d94160\" y=\"79.038216\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"159.226766\" xlink:href=\"#mf9d7d94160\" y=\"49.688004\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"159.712662\" xlink:href=\"#mf9d7d94160\" y=\"46.846353\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"161.561051\" xlink:href=\"#mf9d7d94160\" y=\"68.438166\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"168.815553\" xlink:href=\"#mf9d7d94160\" y=\"82.72152\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"170.925701\" xlink:href=\"#mf9d7d94160\" y=\"70.606253\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"175.354285\" xlink:href=\"#mf9d7d94160\" y=\"60.421674\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"183.945298\" xlink:href=\"#mf9d7d94160\" y=\"84.203227\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"190.719342\" xlink:href=\"#mf9d7d94160\" y=\"100.673936\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"197.658033\" xlink:href=\"#mf9d7d94160\" y=\"100.987988\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"207.486527\" xlink:href=\"#mf9d7d94160\" y=\"80.187496\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"213.694996\" xlink:href=\"#mf9d7d94160\" y=\"96.813843\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"214.969281\" xlink:href=\"#mf9d7d94160\" y=\"84.854198\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"215.353743\" xlink:href=\"#mf9d7d94160\" y=\"87.307127\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"218.737953\" xlink:href=\"#mf9d7d94160\" y=\"104.332631\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"219.697191\" xlink:href=\"#mf9d7d94160\" y=\"106.237449\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"221.852022\" xlink:href=\"#mf9d7d94160\" y=\"105.617372\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"225.762842\" xlink:href=\"#mf9d7d94160\" y=\"102.072125\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"230.026238\" xlink:href=\"#mf9d7d94160\" y=\"86.774461\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 42.620312 146.899219 \n",
       "L 42.620312 10.999219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 237.920313 146.899219 \n",
       "L 237.920313 10.999219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 42.620312 146.899219 \n",
       "L 237.920313 146.899219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 42.620312 10.999219 \n",
       "L 237.920313 10.999219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"patch_7\">\n",
       "     <path d=\"M 173.58125 48.355469 \n",
       "L 230.920313 48.355469 \n",
       "Q 232.920313 48.355469 232.920313 46.355469 \n",
       "L 232.920313 17.999219 \n",
       "Q 232.920313 15.999219 230.920313 15.999219 \n",
       "L 173.58125 15.999219 \n",
       "Q 171.58125 15.999219 171.58125 17.999219 \n",
       "L 171.58125 46.355469 \n",
       "Q 171.58125 48.355469 173.58125 48.355469 \n",
       "z\n",
       "\" style=\"fill:#ffffff;opacity:0.8;stroke:#cccccc;stroke-linejoin:miter;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_30\">\n",
       "     <path d=\"M 175.58125 24.097656 \n",
       "L 195.58125 24.097656 \n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_31\"/>\n",
       "    <g id=\"text_16\">\n",
       "     <!-- Truth -->\n",
       "     <g transform=\"translate(203.58125 27.597656)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M -19 4666 \n",
       "L 3928 4666 \n",
       "L 3928 4134 \n",
       "L 2272 4134 \n",
       "L 2272 0 \n",
       "L 1638 0 \n",
       "L 1638 4134 \n",
       "L -19 4134 \n",
       "L -19 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-54\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2631 2963 \n",
       "Q 2534 3019 2420 3045 \n",
       "Q 2306 3072 2169 3072 \n",
       "Q 1681 3072 1420 2755 \n",
       "Q 1159 2438 1159 1844 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1341 3275 1631 3429 \n",
       "Q 1922 3584 2338 3584 \n",
       "Q 2397 3584 2469 3576 \n",
       "Q 2541 3569 2628 3553 \n",
       "L 2631 2963 \n",
       "z\n",
       "\" id=\"DejaVuSans-72\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 544 1381 \n",
       "L 544 3500 \n",
       "L 1119 3500 \n",
       "L 1119 1403 \n",
       "Q 1119 906 1312 657 \n",
       "Q 1506 409 1894 409 \n",
       "Q 2359 409 2629 706 \n",
       "Q 2900 1003 2900 1516 \n",
       "L 2900 3500 \n",
       "L 3475 3500 \n",
       "L 3475 0 \n",
       "L 2900 0 \n",
       "L 2900 538 \n",
       "Q 2691 219 2414 64 \n",
       "Q 2138 -91 1772 -91 \n",
       "Q 1169 -91 856 284 \n",
       "Q 544 659 544 1381 \n",
       "z\n",
       "M 1991 3584 \n",
       "L 1991 3584 \n",
       "z\n",
       "\" id=\"DejaVuSans-75\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1172 4494 \n",
       "L 1172 3500 \n",
       "L 2356 3500 \n",
       "L 2356 3053 \n",
       "L 1172 3053 \n",
       "L 1172 1153 \n",
       "Q 1172 725 1289 603 \n",
       "Q 1406 481 1766 481 \n",
       "L 2356 481 \n",
       "L 2356 0 \n",
       "L 1766 0 \n",
       "Q 1100 0 847 248 \n",
       "Q 594 497 594 1153 \n",
       "L 594 3053 \n",
       "L 172 3053 \n",
       "L 172 3500 \n",
       "L 594 3500 \n",
       "L 594 4494 \n",
       "L 1172 4494 \n",
       "z\n",
       "\" id=\"DejaVuSans-74\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 4863 \n",
       "L 1159 4863 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" id=\"DejaVuSans-68\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-54\"/>\n",
       "      <use x=\"46.333984\" xlink:href=\"#DejaVuSans-72\"/>\n",
       "      <use x=\"87.447266\" xlink:href=\"#DejaVuSans-75\"/>\n",
       "      <use x=\"150.826172\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"190.035156\" xlink:href=\"#DejaVuSans-68\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_32\">\n",
       "     <path d=\"M 175.58125 38.775781 \n",
       "L 195.58125 38.775781 \n",
       "\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_33\"/>\n",
       "    <g id=\"text_17\">\n",
       "     <!-- Pred -->\n",
       "     <g transform=\"translate(203.58125 42.275781)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 1259 4147 \n",
       "L 1259 2394 \n",
       "L 2053 2394 \n",
       "Q 2494 2394 2734 2622 \n",
       "Q 2975 2850 2975 3272 \n",
       "Q 2975 3691 2734 3919 \n",
       "Q 2494 4147 2053 4147 \n",
       "L 1259 4147 \n",
       "z\n",
       "M 628 4666 \n",
       "L 2053 4666 \n",
       "Q 2838 4666 3239 4311 \n",
       "Q 3641 3956 3641 3272 \n",
       "Q 3641 2581 3239 2228 \n",
       "Q 2838 1875 2053 1875 \n",
       "L 1259 1875 \n",
       "L 1259 0 \n",
       "L 628 0 \n",
       "L 628 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-50\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3597 1894 \n",
       "L 3597 1613 \n",
       "L 953 1613 \n",
       "Q 991 1019 1311 708 \n",
       "Q 1631 397 2203 397 \n",
       "Q 2534 397 2845 478 \n",
       "Q 3156 559 3463 722 \n",
       "L 3463 178 \n",
       "Q 3153 47 2828 -22 \n",
       "Q 2503 -91 2169 -91 \n",
       "Q 1331 -91 842 396 \n",
       "Q 353 884 353 1716 \n",
       "Q 353 2575 817 3079 \n",
       "Q 1281 3584 2069 3584 \n",
       "Q 2775 3584 3186 3129 \n",
       "Q 3597 2675 3597 1894 \n",
       "z\n",
       "M 3022 2063 \n",
       "Q 3016 2534 2758 2815 \n",
       "Q 2500 3097 2075 3097 \n",
       "Q 1594 3097 1305 2825 \n",
       "Q 1016 2553 972 2059 \n",
       "L 3022 2063 \n",
       "z\n",
       "\" id=\"DejaVuSans-65\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2906 2969 \n",
       "L 2906 4863 \n",
       "L 3481 4863 \n",
       "L 3481 0 \n",
       "L 2906 0 \n",
       "L 2906 525 \n",
       "Q 2725 213 2448 61 \n",
       "Q 2172 -91 1784 -91 \n",
       "Q 1150 -91 751 415 \n",
       "Q 353 922 353 1747 \n",
       "Q 353 2572 751 3078 \n",
       "Q 1150 3584 1784 3584 \n",
       "Q 2172 3584 2448 3432 \n",
       "Q 2725 3281 2906 2969 \n",
       "z\n",
       "M 947 1747 \n",
       "Q 947 1113 1208 752 \n",
       "Q 1469 391 1925 391 \n",
       "Q 2381 391 2643 752 \n",
       "Q 2906 1113 2906 1747 \n",
       "Q 2906 2381 2643 2742 \n",
       "Q 2381 3103 1925 3103 \n",
       "Q 1469 3103 1208 2742 \n",
       "Q 947 2381 947 1747 \n",
       "z\n",
       "\" id=\"DejaVuSans-64\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-50\"/>\n",
       "      <use x=\"58.552734\" xlink:href=\"#DejaVuSans-72\"/>\n",
       "      <use x=\"97.416016\" xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use x=\"158.939453\" xlink:href=\"#DejaVuSans-64\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p975401a699\">\n",
       "   <rect height=\"135.9\" width=\"195.3\" x=\"42.620312\" y=\"10.999219\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 252x180 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "def plot_kernel_reg(y_hat):\n",
    "    d2l.plot(x_test, [y_truth, y_hat], 'x', 'y', legend=['Truth', 'Pred'],\n",
    "             xlim=[0, 5], ylim=[-1, 5])\n",
    "    d2l.plt.plot(x_train, y_train, 'o', alpha=0.5);\n",
    "\n",
    "y_hat = d2l.repeat(y_train.mean(), n_test)\n",
    "plot_kernel_reg(y_hat)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "非参数注意力汇聚"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "origin_pos": 19,
    "tab": [
     "pytorch"
    ]
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"184.455469pt\" version=\"1.1\" viewBox=\"0 0 248.301563 184.455469\" width=\"248.301563pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-11-24T11:13:04.879313</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.3, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 184.455469 \n",
       "L 248.301563 184.455469 \n",
       "L 248.301563 -0 \n",
       "L 0 -0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 42.620312 146.899219 \n",
       "L 237.920313 146.899219 \n",
       "L 237.920313 10.999219 \n",
       "L 42.620312 10.999219 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 42.620312 146.899219 \n",
       "L 42.620312 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"mef3abca52c\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mef3abca52c\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(39.439062 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 81.680312 146.899219 \n",
       "L 81.680312 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"81.680312\" xlink:href=\"#mef3abca52c\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(78.499062 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 120.740313 146.899219 \n",
       "L 120.740313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"120.740313\" xlink:href=\"#mef3abca52c\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(117.559062 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 159.800313 146.899219 \n",
       "L 159.800313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"159.800313\" xlink:href=\"#mef3abca52c\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(156.619063 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 198.860313 146.899219 \n",
       "L 198.860313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"198.860313\" xlink:href=\"#mef3abca52c\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(195.679063 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 237.920313 146.899219 \n",
       "L 237.920313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"237.920313\" xlink:href=\"#mef3abca52c\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 5 -->\n",
       "      <g transform=\"translate(234.739063 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_7\">\n",
       "     <!-- x -->\n",
       "     <g transform=\"translate(137.310937 175.175781)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 3513 3500 \n",
       "L 2247 1797 \n",
       "L 3578 0 \n",
       "L 2900 0 \n",
       "L 1881 1375 \n",
       "L 863 0 \n",
       "L 184 0 \n",
       "L 1544 1831 \n",
       "L 300 3500 \n",
       "L 978 3500 \n",
       "L 1906 2253 \n",
       "L 2834 3500 \n",
       "L 3513 3500 \n",
       "z\n",
       "\" id=\"DejaVuSans-78\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-78\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 42.620312 146.899219 \n",
       "L 237.920313 146.899219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"m4e1067d6e9\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m4e1067d6e9\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- −1 -->\n",
       "      <g transform=\"translate(20.878125 150.698437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 678 2272 \n",
       "L 4684 2272 \n",
       "L 4684 1741 \n",
       "L 678 1741 \n",
       "L 678 2272 \n",
       "z\n",
       "\" id=\"DejaVuSans-2212\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-2212\"/>\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 42.620312 124.249219 \n",
       "L 237.920313 124.249219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m4e1067d6e9\" y=\"124.249219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(29.257812 128.048437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 42.620312 101.599219 \n",
       "L 237.920313 101.599219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_18\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m4e1067d6e9\" y=\"101.599219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(29.257812 105.398437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 42.620312 78.949219 \n",
       "L 237.920313 78.949219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_20\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m4e1067d6e9\" y=\"78.949219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(29.257812 82.748437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_21\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 42.620312 56.299219 \n",
       "L 237.920313 56.299219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_22\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m4e1067d6e9\" y=\"56.299219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(29.257812 60.098437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_23\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 42.620312 33.649219 \n",
       "L 237.920313 33.649219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_24\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m4e1067d6e9\" y=\"33.649219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(29.257812 37.448437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_25\">\n",
       "      <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 42.620312 10.999219 \n",
       "L 237.920313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_26\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m4e1067d6e9\" y=\"10.999219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 5 -->\n",
       "      <g transform=\"translate(29.257812 14.798437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_15\">\n",
       "     <!-- y -->\n",
       "     <g transform=\"translate(14.798437 81.908594)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 2059 -325 \n",
       "Q 1816 -950 1584 -1140 \n",
       "Q 1353 -1331 966 -1331 \n",
       "L 506 -1331 \n",
       "L 506 -850 \n",
       "L 844 -850 \n",
       "Q 1081 -850 1212 -737 \n",
       "Q 1344 -625 1503 -206 \n",
       "L 1606 56 \n",
       "L 191 3500 \n",
       "L 800 3500 \n",
       "L 1894 763 \n",
       "L 2988 3500 \n",
       "L 3597 3500 \n",
       "L 2059 -325 \n",
       "z\n",
       "\" id=\"DejaVuSans-79\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-79\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_27\">\n",
       "    <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 42.620312 124.249219 \n",
       "L 46.526313 116.136982 \n",
       "L 50.432313 108.999323 \n",
       "L 54.338313 102.217148 \n",
       "L 58.244313 95.726382 \n",
       "L 62.150312 89.522233 \n",
       "L 66.056313 83.61909 \n",
       "L 69.962312 78.038824 \n",
       "L 73.868313 72.805995 \n",
       "L 77.774314 67.9454 \n",
       "L 81.680312 63.480584 \n",
       "L 85.586313 59.432954 \n",
       "L 89.492314 55.821098 \n",
       "L 93.398315 52.660253 \n",
       "L 97.304312 49.962036 \n",
       "L 101.210313 47.734078 \n",
       "L 105.116313 45.979916 \n",
       "L 109.022314 44.698804 \n",
       "L 112.928315 43.885737 \n",
       "L 116.834312 43.531366 \n",
       "L 120.740313 43.6221 \n",
       "L 124.646318 44.140188 \n",
       "L 128.552314 45.063862 \n",
       "L 132.458311 46.367563 \n",
       "L 136.364316 48.022135 \n",
       "L 140.270312 49.995102 \n",
       "L 144.176318 52.251038 \n",
       "L 148.082314 54.751808 \n",
       "L 151.988311 57.457028 \n",
       "L 155.894316 60.324422 \n",
       "L 159.800313 63.310198 \n",
       "L 163.706318 66.369546 \n",
       "L 167.612314 69.457035 \n",
       "L 171.518311 72.527086 \n",
       "L 175.424316 75.534393 \n",
       "L 179.330312 78.434376 \n",
       "L 183.236318 81.183649 \n",
       "L 187.142314 83.740421 \n",
       "L 191.048311 86.06491 \n",
       "L 194.954316 88.119776 \n",
       "L 198.860313 89.870418 \n",
       "L 202.766309 91.285373 \n",
       "L 206.672324 92.336626 \n",
       "L 210.57832 92.999866 \n",
       "L 214.484316 93.254724 \n",
       "L 218.390312 93.084991 \n",
       "L 222.296309 92.478762 \n",
       "L 226.202324 91.428564 \n",
       "L 230.10832 89.931456 \n",
       "L 234.014316 87.988968 \n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_28\">\n",
       "    <path clip-path=\"url(#p6b5e3d8794)\" d=\"M 42.620312 81.482282 \n",
       "L 46.526313 79.395468 \n",
       "L 50.432313 77.284543 \n",
       "L 54.338313 75.169065 \n",
       "L 58.244313 73.070177 \n",
       "L 62.150312 71.009992 \n",
       "L 66.056313 69.010829 \n",
       "L 69.962312 67.094429 \n",
       "L 73.868313 65.281134 \n",
       "L 77.774314 63.589268 \n",
       "L 81.680312 62.034486 \n",
       "L 85.586313 60.629424 \n",
       "L 89.492314 59.383554 \n",
       "L 93.398315 58.303139 \n",
       "L 97.304312 57.391427 \n",
       "L 101.210313 56.648978 \n",
       "L 105.116313 56.074053 \n",
       "L 109.022314 55.663148 \n",
       "L 112.928315 55.411407 \n",
       "L 116.834312 55.313113 \n",
       "L 120.740313 55.362071 \n",
       "L 124.646318 55.551958 \n",
       "L 128.552314 55.876568 \n",
       "L 132.458311 56.329951 \n",
       "L 136.364316 56.906572 \n",
       "L 140.270312 57.601229 \n",
       "L 144.176318 58.408983 \n",
       "L 148.082314 59.325059 \n",
       "L 151.988311 60.344581 \n",
       "L 155.894316 61.462359 \n",
       "L 159.800313 62.672566 \n",
       "L 163.706318 63.968496 \n",
       "L 167.612314 65.342281 \n",
       "L 171.518311 66.784723 \n",
       "L 175.424316 68.285179 \n",
       "L 179.330312 69.83151 \n",
       "L 183.236318 71.41028 \n",
       "L 187.142314 73.006979 \n",
       "L 191.048311 74.606426 \n",
       "L 194.954316 76.193296 \n",
       "L 198.860313 77.752571 \n",
       "L 202.766309 79.270187 \n",
       "L 206.672324 80.733492 \n",
       "L 210.57832 82.131616 \n",
       "L 214.484316 83.455837 \n",
       "L 218.390312 84.699661 \n",
       "L 222.296309 85.858855 \n",
       "L 226.202324 86.931345 \n",
       "L 230.10832 87.916943 \n",
       "L 234.014316 88.817161 \n",
       "\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_29\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 3 \n",
       "C 0.795609 3 1.55874 2.683901 2.12132 2.12132 \n",
       "C 2.683901 1.55874 3 0.795609 3 0 \n",
       "C 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \n",
       "C 1.55874 -2.683901 0.795609 -3 0 -3 \n",
       "C -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \n",
       "C -2.683901 -1.55874 -3 -0.795609 -3 0 \n",
       "C -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \n",
       "C -1.55874 2.683901 -0.795609 3 0 3 \n",
       "z\n",
       "\" id=\"mb0350cc1a0\" style=\"stroke:#ff7f0e;stroke-opacity:0.5;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p6b5e3d8794)\">\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"46.200385\" xlink:href=\"#mb0350cc1a0\" y=\"132.583698\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"47.924768\" xlink:href=\"#mb0350cc1a0\" y=\"113.325927\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"50.623843\" xlink:href=\"#mb0350cc1a0\" y=\"117.179436\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"52.458427\" xlink:href=\"#mb0350cc1a0\" y=\"88.557466\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"64.520449\" xlink:href=\"#mb0350cc1a0\" y=\"100.786084\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"73.26929\" xlink:href=\"#mb0350cc1a0\" y=\"57.854444\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"82.916341\" xlink:href=\"#mb0350cc1a0\" y=\"70.948343\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"85.728853\" xlink:href=\"#mb0350cc1a0\" y=\"60.691477\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"96.96157\" xlink:href=\"#mb0350cc1a0\" y=\"45.889798\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"102.040585\" xlink:href=\"#mb0350cc1a0\" y=\"47.581286\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"102.522308\" xlink:href=\"#mb0350cc1a0\" y=\"40.568492\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"108.279087\" xlink:href=\"#mb0350cc1a0\" y=\"33.989441\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"115.219381\" xlink:href=\"#mb0350cc1a0\" y=\"23.368117\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"115.403496\" xlink:href=\"#mb0350cc1a0\" y=\"35.860452\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"116.265044\" xlink:href=\"#mb0350cc1a0\" y=\"59.176532\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"117.878802\" xlink:href=\"#mb0350cc1a0\" y=\"58.52277\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"117.950756\" xlink:href=\"#mb0350cc1a0\" y=\"61.61007\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"121.239833\" xlink:href=\"#mb0350cc1a0\" y=\"42.719978\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"122.097768\" xlink:href=\"#mb0350cc1a0\" y=\"37.86042\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"123.054911\" xlink:href=\"#mb0350cc1a0\" y=\"51.738939\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"131.102122\" xlink:href=\"#mb0350cc1a0\" y=\"58.714363\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"134.89429\" xlink:href=\"#mb0350cc1a0\" y=\"28.899414\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"136.853732\" xlink:href=\"#mb0350cc1a0\" y=\"37.786524\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"139.789175\" xlink:href=\"#mb0350cc1a0\" y=\"42.523222\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"140.606377\" xlink:href=\"#mb0350cc1a0\" y=\"46.500072\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"143.549103\" xlink:href=\"#mb0350cc1a0\" y=\"55.042138\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"145.754241\" xlink:href=\"#mb0350cc1a0\" y=\"55.526777\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"149.165103\" xlink:href=\"#mb0350cc1a0\" y=\"62.679365\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"152.964367\" xlink:href=\"#mb0350cc1a0\" y=\"58.149683\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"154.910036\" xlink:href=\"#mb0350cc1a0\" y=\"70.294111\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"157.887834\" xlink:href=\"#mb0350cc1a0\" y=\"74.553083\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"158.961533\" xlink:href=\"#mb0350cc1a0\" y=\"79.038216\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"159.226766\" xlink:href=\"#mb0350cc1a0\" y=\"49.688004\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"159.712662\" xlink:href=\"#mb0350cc1a0\" y=\"46.846353\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"161.561051\" xlink:href=\"#mb0350cc1a0\" y=\"68.438166\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"168.815553\" xlink:href=\"#mb0350cc1a0\" y=\"82.72152\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"170.925701\" xlink:href=\"#mb0350cc1a0\" y=\"70.606253\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"175.354285\" xlink:href=\"#mb0350cc1a0\" y=\"60.421674\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"183.945298\" xlink:href=\"#mb0350cc1a0\" y=\"84.203227\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"190.719342\" xlink:href=\"#mb0350cc1a0\" y=\"100.673936\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"197.658033\" xlink:href=\"#mb0350cc1a0\" y=\"100.987988\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"207.486527\" xlink:href=\"#mb0350cc1a0\" y=\"80.187496\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"213.694996\" xlink:href=\"#mb0350cc1a0\" y=\"96.813843\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"214.969281\" xlink:href=\"#mb0350cc1a0\" y=\"84.854198\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"215.353743\" xlink:href=\"#mb0350cc1a0\" y=\"87.307127\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"218.737953\" xlink:href=\"#mb0350cc1a0\" y=\"104.332631\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"219.697191\" xlink:href=\"#mb0350cc1a0\" y=\"106.237449\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"221.852022\" xlink:href=\"#mb0350cc1a0\" y=\"105.617372\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"225.762842\" xlink:href=\"#mb0350cc1a0\" y=\"102.072125\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"230.026238\" xlink:href=\"#mb0350cc1a0\" y=\"86.774461\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 42.620312 146.899219 \n",
       "L 42.620312 10.999219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 237.920313 146.899219 \n",
       "L 237.920313 10.999219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 42.620312 146.899219 \n",
       "L 237.920313 146.899219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 42.620312 10.999219 \n",
       "L 237.920313 10.999219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"patch_7\">\n",
       "     <path d=\"M 173.58125 48.355469 \n",
       "L 230.920313 48.355469 \n",
       "Q 232.920313 48.355469 232.920313 46.355469 \n",
       "L 232.920313 17.999219 \n",
       "Q 232.920313 15.999219 230.920313 15.999219 \n",
       "L 173.58125 15.999219 \n",
       "Q 171.58125 15.999219 171.58125 17.999219 \n",
       "L 171.58125 46.355469 \n",
       "Q 171.58125 48.355469 173.58125 48.355469 \n",
       "z\n",
       "\" style=\"fill:#ffffff;opacity:0.8;stroke:#cccccc;stroke-linejoin:miter;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_30\">\n",
       "     <path d=\"M 175.58125 24.097656 \n",
       "L 195.58125 24.097656 \n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_31\"/>\n",
       "    <g id=\"text_16\">\n",
       "     <!-- Truth -->\n",
       "     <g transform=\"translate(203.58125 27.597656)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M -19 4666 \n",
       "L 3928 4666 \n",
       "L 3928 4134 \n",
       "L 2272 4134 \n",
       "L 2272 0 \n",
       "L 1638 0 \n",
       "L 1638 4134 \n",
       "L -19 4134 \n",
       "L -19 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-54\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2631 2963 \n",
       "Q 2534 3019 2420 3045 \n",
       "Q 2306 3072 2169 3072 \n",
       "Q 1681 3072 1420 2755 \n",
       "Q 1159 2438 1159 1844 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1341 3275 1631 3429 \n",
       "Q 1922 3584 2338 3584 \n",
       "Q 2397 3584 2469 3576 \n",
       "Q 2541 3569 2628 3553 \n",
       "L 2631 2963 \n",
       "z\n",
       "\" id=\"DejaVuSans-72\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 544 1381 \n",
       "L 544 3500 \n",
       "L 1119 3500 \n",
       "L 1119 1403 \n",
       "Q 1119 906 1312 657 \n",
       "Q 1506 409 1894 409 \n",
       "Q 2359 409 2629 706 \n",
       "Q 2900 1003 2900 1516 \n",
       "L 2900 3500 \n",
       "L 3475 3500 \n",
       "L 3475 0 \n",
       "L 2900 0 \n",
       "L 2900 538 \n",
       "Q 2691 219 2414 64 \n",
       "Q 2138 -91 1772 -91 \n",
       "Q 1169 -91 856 284 \n",
       "Q 544 659 544 1381 \n",
       "z\n",
       "M 1991 3584 \n",
       "L 1991 3584 \n",
       "z\n",
       "\" id=\"DejaVuSans-75\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1172 4494 \n",
       "L 1172 3500 \n",
       "L 2356 3500 \n",
       "L 2356 3053 \n",
       "L 1172 3053 \n",
       "L 1172 1153 \n",
       "Q 1172 725 1289 603 \n",
       "Q 1406 481 1766 481 \n",
       "L 2356 481 \n",
       "L 2356 0 \n",
       "L 1766 0 \n",
       "Q 1100 0 847 248 \n",
       "Q 594 497 594 1153 \n",
       "L 594 3053 \n",
       "L 172 3053 \n",
       "L 172 3500 \n",
       "L 594 3500 \n",
       "L 594 4494 \n",
       "L 1172 4494 \n",
       "z\n",
       "\" id=\"DejaVuSans-74\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 4863 \n",
       "L 1159 4863 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" id=\"DejaVuSans-68\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-54\"/>\n",
       "      <use x=\"46.333984\" xlink:href=\"#DejaVuSans-72\"/>\n",
       "      <use x=\"87.447266\" xlink:href=\"#DejaVuSans-75\"/>\n",
       "      <use x=\"150.826172\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"190.035156\" xlink:href=\"#DejaVuSans-68\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_32\">\n",
       "     <path d=\"M 175.58125 38.775781 \n",
       "L 195.58125 38.775781 \n",
       "\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_33\"/>\n",
       "    <g id=\"text_17\">\n",
       "     <!-- Pred -->\n",
       "     <g transform=\"translate(203.58125 42.275781)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 1259 4147 \n",
       "L 1259 2394 \n",
       "L 2053 2394 \n",
       "Q 2494 2394 2734 2622 \n",
       "Q 2975 2850 2975 3272 \n",
       "Q 2975 3691 2734 3919 \n",
       "Q 2494 4147 2053 4147 \n",
       "L 1259 4147 \n",
       "z\n",
       "M 628 4666 \n",
       "L 2053 4666 \n",
       "Q 2838 4666 3239 4311 \n",
       "Q 3641 3956 3641 3272 \n",
       "Q 3641 2581 3239 2228 \n",
       "Q 2838 1875 2053 1875 \n",
       "L 1259 1875 \n",
       "L 1259 0 \n",
       "L 628 0 \n",
       "L 628 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-50\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3597 1894 \n",
       "L 3597 1613 \n",
       "L 953 1613 \n",
       "Q 991 1019 1311 708 \n",
       "Q 1631 397 2203 397 \n",
       "Q 2534 397 2845 478 \n",
       "Q 3156 559 3463 722 \n",
       "L 3463 178 \n",
       "Q 3153 47 2828 -22 \n",
       "Q 2503 -91 2169 -91 \n",
       "Q 1331 -91 842 396 \n",
       "Q 353 884 353 1716 \n",
       "Q 353 2575 817 3079 \n",
       "Q 1281 3584 2069 3584 \n",
       "Q 2775 3584 3186 3129 \n",
       "Q 3597 2675 3597 1894 \n",
       "z\n",
       "M 3022 2063 \n",
       "Q 3016 2534 2758 2815 \n",
       "Q 2500 3097 2075 3097 \n",
       "Q 1594 3097 1305 2825 \n",
       "Q 1016 2553 972 2059 \n",
       "L 3022 2063 \n",
       "z\n",
       "\" id=\"DejaVuSans-65\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2906 2969 \n",
       "L 2906 4863 \n",
       "L 3481 4863 \n",
       "L 3481 0 \n",
       "L 2906 0 \n",
       "L 2906 525 \n",
       "Q 2725 213 2448 61 \n",
       "Q 2172 -91 1784 -91 \n",
       "Q 1150 -91 751 415 \n",
       "Q 353 922 353 1747 \n",
       "Q 353 2572 751 3078 \n",
       "Q 1150 3584 1784 3584 \n",
       "Q 2172 3584 2448 3432 \n",
       "Q 2725 3281 2906 2969 \n",
       "z\n",
       "M 947 1747 \n",
       "Q 947 1113 1208 752 \n",
       "Q 1469 391 1925 391 \n",
       "Q 2381 391 2643 752 \n",
       "Q 2906 1113 2906 1747 \n",
       "Q 2906 2381 2643 2742 \n",
       "Q 2381 3103 1925 3103 \n",
       "Q 1469 3103 1208 2742 \n",
       "Q 947 2381 947 1747 \n",
       "z\n",
       "\" id=\"DejaVuSans-64\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-50\"/>\n",
       "      <use x=\"58.552734\" xlink:href=\"#DejaVuSans-72\"/>\n",
       "      <use x=\"97.416016\" xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use x=\"158.939453\" xlink:href=\"#DejaVuSans-64\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p6b5e3d8794\">\n",
       "   <rect height=\"135.9\" width=\"195.3\" x=\"42.620312\" y=\"10.999219\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 252x180 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# X_repeat的形状:(n_test,n_train),\n",
    "# 每一行都包含着相同的测试输入（例如：同样的查询）\n",
    "X_repeat = d2l.reshape(x_test.repeat(n_train), (-1, n_train))\n",
    "# x_train包含着键。attention_weights的形状：(n_test,n_train),\n",
    "# 每一行都包含着要在给定的每个查询的值（y_train）之间分配的注意力权重\n",
    "attention_weights = nn.Softmax(axis=1)(-(X_repeat - x_train)**2 / 2)\n",
    "# y_hat的每个元素都是值的加权平均值，其中的权重是注意力权重\n",
    "y_hat = d2l.matmul(attention_weights, y_train)\n",
    "plot_kernel_reg(y_hat)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "注意力权重"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "origin_pos": 23,
    "tab": [
     "pytorch"
    ]
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"159.039469pt\" version=\"1.1\" viewBox=\"0 0 199.72075 159.039469\" width=\"199.72075pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-11-24T11:13:05.178476</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.3, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 159.039469 \n",
       "L 199.72075 159.039469 \n",
       "L 199.72075 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 40.603125 121.483219 \n",
       "L 152.203125 121.483219 \n",
       "L 152.203125 9.883219 \n",
       "L 40.603125 9.883219 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g clip-path=\"url(#pd94640048c)\">\n",
       "    <image height=\"112\" id=\"image9553d886a5\" transform=\"scale(1 -1)translate(0 -112)\" width=\"112\" x=\"40.603125\" xlink:href=\"data:image/png;base64,\n",
       "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\" y=\"-9.483219\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"m7f0fde0829\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"41.719125\" xlink:href=\"#m7f0fde0829\" y=\"121.483219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(38.537875 136.081656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"86.359125\" xlink:href=\"#m7f0fde0829\" y=\"121.483219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 20 -->\n",
       "      <g transform=\"translate(79.996625 136.081656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"130.999125\" xlink:href=\"#m7f0fde0829\" y=\"121.483219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 40 -->\n",
       "      <g transform=\"translate(124.636625 136.081656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_4\">\n",
       "     <!-- Sorted training inputs -->\n",
       "     <g transform=\"translate(41.889844 149.759781)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 3425 4513 \n",
       "L 3425 3897 \n",
       "Q 3066 4069 2747 4153 \n",
       "Q 2428 4238 2131 4238 \n",
       "Q 1616 4238 1336 4038 \n",
       "Q 1056 3838 1056 3469 \n",
       "Q 1056 3159 1242 3001 \n",
       "Q 1428 2844 1947 2747 \n",
       "L 2328 2669 \n",
       "Q 3034 2534 3370 2195 \n",
       "Q 3706 1856 3706 1288 \n",
       "Q 3706 609 3251 259 \n",
       "Q 2797 -91 1919 -91 \n",
       "Q 1588 -91 1214 -16 \n",
       "Q 841 59 441 206 \n",
       "L 441 856 \n",
       "Q 825 641 1194 531 \n",
       "Q 1563 422 1919 422 \n",
       "Q 2459 422 2753 634 \n",
       "Q 3047 847 3047 1241 \n",
       "Q 3047 1584 2836 1778 \n",
       "Q 2625 1972 2144 2069 \n",
       "L 1759 2144 \n",
       "Q 1053 2284 737 2584 \n",
       "Q 422 2884 422 3419 \n",
       "Q 422 4038 858 4394 \n",
       "Q 1294 4750 2059 4750 \n",
       "Q 2388 4750 2728 4690 \n",
       "Q 3069 4631 3425 4513 \n",
       "z\n",
       "\" id=\"DejaVuSans-53\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1959 3097 \n",
       "Q 1497 3097 1228 2736 \n",
       "Q 959 2375 959 1747 \n",
       "Q 959 1119 1226 758 \n",
       "Q 1494 397 1959 397 \n",
       "Q 2419 397 2687 759 \n",
       "Q 2956 1122 2956 1747 \n",
       "Q 2956 2369 2687 2733 \n",
       "Q 2419 3097 1959 3097 \n",
       "z\n",
       "M 1959 3584 \n",
       "Q 2709 3584 3137 3096 \n",
       "Q 3566 2609 3566 1747 \n",
       "Q 3566 888 3137 398 \n",
       "Q 2709 -91 1959 -91 \n",
       "Q 1206 -91 779 398 \n",
       "Q 353 888 353 1747 \n",
       "Q 353 2609 779 3096 \n",
       "Q 1206 3584 1959 3584 \n",
       "z\n",
       "\" id=\"DejaVuSans-6f\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2631 2963 \n",
       "Q 2534 3019 2420 3045 \n",
       "Q 2306 3072 2169 3072 \n",
       "Q 1681 3072 1420 2755 \n",
       "Q 1159 2438 1159 1844 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1341 3275 1631 3429 \n",
       "Q 1922 3584 2338 3584 \n",
       "Q 2397 3584 2469 3576 \n",
       "Q 2541 3569 2628 3553 \n",
       "L 2631 2963 \n",
       "z\n",
       "\" id=\"DejaVuSans-72\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1172 4494 \n",
       "L 1172 3500 \n",
       "L 2356 3500 \n",
       "L 2356 3053 \n",
       "L 1172 3053 \n",
       "L 1172 1153 \n",
       "Q 1172 725 1289 603 \n",
       "Q 1406 481 1766 481 \n",
       "L 2356 481 \n",
       "L 2356 0 \n",
       "L 1766 0 \n",
       "Q 1100 0 847 248 \n",
       "Q 594 497 594 1153 \n",
       "L 594 3053 \n",
       "L 172 3053 \n",
       "L 172 3500 \n",
       "L 594 3500 \n",
       "L 594 4494 \n",
       "L 1172 4494 \n",
       "z\n",
       "\" id=\"DejaVuSans-74\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3597 1894 \n",
       "L 3597 1613 \n",
       "L 953 1613 \n",
       "Q 991 1019 1311 708 \n",
       "Q 1631 397 2203 397 \n",
       "Q 2534 397 2845 478 \n",
       "Q 3156 559 3463 722 \n",
       "L 3463 178 \n",
       "Q 3153 47 2828 -22 \n",
       "Q 2503 -91 2169 -91 \n",
       "Q 1331 -91 842 396 \n",
       "Q 353 884 353 1716 \n",
       "Q 353 2575 817 3079 \n",
       "Q 1281 3584 2069 3584 \n",
       "Q 2775 3584 3186 3129 \n",
       "Q 3597 2675 3597 1894 \n",
       "z\n",
       "M 3022 2063 \n",
       "Q 3016 2534 2758 2815 \n",
       "Q 2500 3097 2075 3097 \n",
       "Q 1594 3097 1305 2825 \n",
       "Q 1016 2553 972 2059 \n",
       "L 3022 2063 \n",
       "z\n",
       "\" id=\"DejaVuSans-65\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2906 2969 \n",
       "L 2906 4863 \n",
       "L 3481 4863 \n",
       "L 3481 0 \n",
       "L 2906 0 \n",
       "L 2906 525 \n",
       "Q 2725 213 2448 61 \n",
       "Q 2172 -91 1784 -91 \n",
       "Q 1150 -91 751 415 \n",
       "Q 353 922 353 1747 \n",
       "Q 353 2572 751 3078 \n",
       "Q 1150 3584 1784 3584 \n",
       "Q 2172 3584 2448 3432 \n",
       "Q 2725 3281 2906 2969 \n",
       "z\n",
       "M 947 1747 \n",
       "Q 947 1113 1208 752 \n",
       "Q 1469 391 1925 391 \n",
       "Q 2381 391 2643 752 \n",
       "Q 2906 1113 2906 1747 \n",
       "Q 2906 2381 2643 2742 \n",
       "Q 2381 3103 1925 3103 \n",
       "Q 1469 3103 1208 2742 \n",
       "Q 947 2381 947 1747 \n",
       "z\n",
       "\" id=\"DejaVuSans-64\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-20\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2194 1759 \n",
       "Q 1497 1759 1228 1600 \n",
       "Q 959 1441 959 1056 \n",
       "Q 959 750 1161 570 \n",
       "Q 1363 391 1709 391 \n",
       "Q 2188 391 2477 730 \n",
       "Q 2766 1069 2766 1631 \n",
       "L 2766 1759 \n",
       "L 2194 1759 \n",
       "z\n",
       "M 3341 1997 \n",
       "L 3341 0 \n",
       "L 2766 0 \n",
       "L 2766 531 \n",
       "Q 2569 213 2275 61 \n",
       "Q 1981 -91 1556 -91 \n",
       "Q 1019 -91 701 211 \n",
       "Q 384 513 384 1019 \n",
       "Q 384 1609 779 1909 \n",
       "Q 1175 2209 1959 2209 \n",
       "L 2766 2209 \n",
       "L 2766 2266 \n",
       "Q 2766 2663 2505 2880 \n",
       "Q 2244 3097 1772 3097 \n",
       "Q 1472 3097 1187 3025 \n",
       "Q 903 2953 641 2809 \n",
       "L 641 3341 \n",
       "Q 956 3463 1253 3523 \n",
       "Q 1550 3584 1831 3584 \n",
       "Q 2591 3584 2966 3190 \n",
       "Q 3341 2797 3341 1997 \n",
       "z\n",
       "\" id=\"DejaVuSans-61\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 603 3500 \n",
       "L 1178 3500 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 3500 \n",
       "z\n",
       "M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 4134 \n",
       "L 603 4134 \n",
       "L 603 4863 \n",
       "z\n",
       "\" id=\"DejaVuSans-69\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" id=\"DejaVuSans-6e\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2906 1791 \n",
       "Q 2906 2416 2648 2759 \n",
       "Q 2391 3103 1925 3103 \n",
       "Q 1463 3103 1205 2759 \n",
       "Q 947 2416 947 1791 \n",
       "Q 947 1169 1205 825 \n",
       "Q 1463 481 1925 481 \n",
       "Q 2391 481 2648 825 \n",
       "Q 2906 1169 2906 1791 \n",
       "z\n",
       "M 3481 434 \n",
       "Q 3481 -459 3084 -895 \n",
       "Q 2688 -1331 1869 -1331 \n",
       "Q 1566 -1331 1297 -1286 \n",
       "Q 1028 -1241 775 -1147 \n",
       "L 775 -588 \n",
       "Q 1028 -725 1275 -790 \n",
       "Q 1522 -856 1778 -856 \n",
       "Q 2344 -856 2625 -561 \n",
       "Q 2906 -266 2906 331 \n",
       "L 2906 616 \n",
       "Q 2728 306 2450 153 \n",
       "Q 2172 0 1784 0 \n",
       "Q 1141 0 747 490 \n",
       "Q 353 981 353 1791 \n",
       "Q 353 2603 747 3093 \n",
       "Q 1141 3584 1784 3584 \n",
       "Q 2172 3584 2450 3431 \n",
       "Q 2728 3278 2906 2969 \n",
       "L 2906 3500 \n",
       "L 3481 3500 \n",
       "L 3481 434 \n",
       "z\n",
       "\" id=\"DejaVuSans-67\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1159 525 \n",
       "L 1159 -1331 \n",
       "L 581 -1331 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2969 \n",
       "Q 1341 3281 1617 3432 \n",
       "Q 1894 3584 2278 3584 \n",
       "Q 2916 3584 3314 3078 \n",
       "Q 3713 2572 3713 1747 \n",
       "Q 3713 922 3314 415 \n",
       "Q 2916 -91 2278 -91 \n",
       "Q 1894 -91 1617 61 \n",
       "Q 1341 213 1159 525 \n",
       "z\n",
       "M 3116 1747 \n",
       "Q 3116 2381 2855 2742 \n",
       "Q 2594 3103 2138 3103 \n",
       "Q 1681 3103 1420 2742 \n",
       "Q 1159 2381 1159 1747 \n",
       "Q 1159 1113 1420 752 \n",
       "Q 1681 391 2138 391 \n",
       "Q 2594 391 2855 752 \n",
       "Q 3116 1113 3116 1747 \n",
       "z\n",
       "\" id=\"DejaVuSans-70\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 544 1381 \n",
       "L 544 3500 \n",
       "L 1119 3500 \n",
       "L 1119 1403 \n",
       "Q 1119 906 1312 657 \n",
       "Q 1506 409 1894 409 \n",
       "Q 2359 409 2629 706 \n",
       "Q 2900 1003 2900 1516 \n",
       "L 2900 3500 \n",
       "L 3475 3500 \n",
       "L 3475 0 \n",
       "L 2900 0 \n",
       "L 2900 538 \n",
       "Q 2691 219 2414 64 \n",
       "Q 2138 -91 1772 -91 \n",
       "Q 1169 -91 856 284 \n",
       "Q 544 659 544 1381 \n",
       "z\n",
       "M 1991 3584 \n",
       "L 1991 3584 \n",
       "z\n",
       "\" id=\"DejaVuSans-75\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2834 3397 \n",
       "L 2834 2853 \n",
       "Q 2591 2978 2328 3040 \n",
       "Q 2066 3103 1784 3103 \n",
       "Q 1356 3103 1142 2972 \n",
       "Q 928 2841 928 2578 \n",
       "Q 928 2378 1081 2264 \n",
       "Q 1234 2150 1697 2047 \n",
       "L 1894 2003 \n",
       "Q 2506 1872 2764 1633 \n",
       "Q 3022 1394 3022 966 \n",
       "Q 3022 478 2636 193 \n",
       "Q 2250 -91 1575 -91 \n",
       "Q 1294 -91 989 -36 \n",
       "Q 684 19 347 128 \n",
       "L 347 722 \n",
       "Q 666 556 975 473 \n",
       "Q 1284 391 1588 391 \n",
       "Q 1994 391 2212 530 \n",
       "Q 2431 669 2431 922 \n",
       "Q 2431 1156 2273 1281 \n",
       "Q 2116 1406 1581 1522 \n",
       "L 1381 1569 \n",
       "Q 847 1681 609 1914 \n",
       "Q 372 2147 372 2553 \n",
       "Q 372 3047 722 3315 \n",
       "Q 1072 3584 1716 3584 \n",
       "Q 2034 3584 2315 3537 \n",
       "Q 2597 3491 2834 3397 \n",
       "z\n",
       "\" id=\"DejaVuSans-73\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-53\"/>\n",
       "      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-6f\"/>\n",
       "      <use x=\"124.658203\" xlink:href=\"#DejaVuSans-72\"/>\n",
       "      <use x=\"165.771484\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"204.980469\" xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use x=\"266.503906\" xlink:href=\"#DejaVuSans-64\"/>\n",
       "      <use x=\"329.980469\" xlink:href=\"#DejaVuSans-20\"/>\n",
       "      <use x=\"361.767578\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"400.976562\" xlink:href=\"#DejaVuSans-72\"/>\n",
       "      <use x=\"442.089844\" xlink:href=\"#DejaVuSans-61\"/>\n",
       "      <use x=\"503.369141\" xlink:href=\"#DejaVuSans-69\"/>\n",
       "      <use x=\"531.152344\" xlink:href=\"#DejaVuSans-6e\"/>\n",
       "      <use x=\"594.53125\" xlink:href=\"#DejaVuSans-69\"/>\n",
       "      <use x=\"622.314453\" xlink:href=\"#DejaVuSans-6e\"/>\n",
       "      <use x=\"685.693359\" xlink:href=\"#DejaVuSans-67\"/>\n",
       "      <use x=\"749.169922\" xlink:href=\"#DejaVuSans-20\"/>\n",
       "      <use x=\"780.957031\" xlink:href=\"#DejaVuSans-69\"/>\n",
       "      <use x=\"808.740234\" xlink:href=\"#DejaVuSans-6e\"/>\n",
       "      <use x=\"872.119141\" xlink:href=\"#DejaVuSans-70\"/>\n",
       "      <use x=\"935.595703\" xlink:href=\"#DejaVuSans-75\"/>\n",
       "      <use x=\"998.974609\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"1038.183594\" xlink:href=\"#DejaVuSans-73\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"ma5cabed700\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#ma5cabed700\" y=\"10.999219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(27.240625 14.798437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#ma5cabed700\" y=\"33.319219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 10 -->\n",
       "      <g transform=\"translate(20.878125 37.118437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#ma5cabed700\" y=\"55.639219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 20 -->\n",
       "      <g transform=\"translate(20.878125 59.438437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#ma5cabed700\" y=\"77.959219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 30 -->\n",
       "      <g transform=\"translate(20.878125 81.758437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#ma5cabed700\" y=\"100.279219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 40 -->\n",
       "      <g transform=\"translate(20.878125 104.078437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_10\">\n",
       "     <!-- Sorted testing inputs -->\n",
       "     <g transform=\"translate(14.798438 118.160562)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSans-53\"/>\n",
       "      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-6f\"/>\n",
       "      <use x=\"124.658203\" xlink:href=\"#DejaVuSans-72\"/>\n",
       "      <use x=\"165.771484\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"204.980469\" xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use x=\"266.503906\" xlink:href=\"#DejaVuSans-64\"/>\n",
       "      <use x=\"329.980469\" xlink:href=\"#DejaVuSans-20\"/>\n",
       "      <use x=\"361.767578\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"400.976562\" xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use x=\"462.5\" xlink:href=\"#DejaVuSans-73\"/>\n",
       "      <use x=\"514.599609\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"553.808594\" xlink:href=\"#DejaVuSans-69\"/>\n",
       "      <use x=\"581.591797\" xlink:href=\"#DejaVuSans-6e\"/>\n",
       "      <use x=\"644.970703\" xlink:href=\"#DejaVuSans-67\"/>\n",
       "      <use x=\"708.447266\" xlink:href=\"#DejaVuSans-20\"/>\n",
       "      <use x=\"740.234375\" xlink:href=\"#DejaVuSans-69\"/>\n",
       "      <use x=\"768.017578\" xlink:href=\"#DejaVuSans-6e\"/>\n",
       "      <use x=\"831.396484\" xlink:href=\"#DejaVuSans-70\"/>\n",
       "      <use x=\"894.873047\" xlink:href=\"#DejaVuSans-75\"/>\n",
       "      <use x=\"958.251953\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"997.460938\" xlink:href=\"#DejaVuSans-73\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 40.603125 121.483219 \n",
       "L 40.603125 9.883219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 152.203125 121.483219 \n",
       "L 152.203125 9.883219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 40.603125 121.483219 \n",
       "L 152.203125 121.483219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 40.603125 9.883219 \n",
       "L 152.203125 9.883219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       "  <g id=\"axes_2\">\n",
       "   <g id=\"patch_7\">\n",
       "    <path d=\"M 159.178125 106.453219 \n",
       "L 163.255125 106.453219 \n",
       "L 163.255125 24.913219 \n",
       "L 159.178125 24.913219 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_8\">\n",
       "    <path clip-path=\"url(#p3e077ffc2a)\" d=\"M 159.178125 106.453219 \n",
       "L 159.178125 106.134703 \n",
       "L 159.178125 25.231734 \n",
       "L 159.178125 24.913219 \n",
       "L 163.255125 24.913219 \n",
       "L 163.255125 25.231734 \n",
       "L 163.255125 106.134703 \n",
       "L 163.255125 106.453219 \n",
       "L 163.255125 106.453219 \n",
       "z\n",
       "\" style=\"fill:#ffffff;stroke:#ffffff;stroke-linejoin:miter;stroke-width:0.01;\"/>\n",
       "   </g>\n",
       "   <image height=\"81\" id=\"image4ff144c9ed\" transform=\"scale(1 -1)translate(0 -81)\" width=\"4\" x=\"159\" xlink:href=\"data:image/png;base64,\n",
       "iVBORw0KGgoAAAANSUhEUgAAAAQAAABRCAYAAAD1sgc6AAAAnklEQVR4nJ2Suw7CQAwEjZT//1QqCnR+0XKzJxmSLqPx7krJo1/Ptq/nsgzbQRVBDqBH4wCkhTtkWDhqR8OSIHjii6H/Z2jtaLD2EDpm3DCkNvldftgB0GJIqM/TBfAfE+AAJcaSpZJRg1Fs0QyCjN5BRA0gkycEmTyRFhox7simsb/blSbGDWCDcdgB4MxwGu8CWAJ4shgqJ9IiBms/jwXJt9gA8G4AAAAASUVORK5CYII=\" y=\"-25\"/>\n",
       "   <g id=\"matplotlib.axis_3\"/>\n",
       "   <g id=\"matplotlib.axis_4\">\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 3.5 0 \n",
       "\" id=\"me18bf5e0a6\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#me18bf5e0a6\" y=\"67.173967\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 0.05 -->\n",
       "      <g transform=\"translate(170.255125 70.973186)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 684 794 \n",
       "L 1344 794 \n",
       "L 1344 0 \n",
       "L 684 0 \n",
       "L 684 794 \n",
       "z\n",
       "\" id=\"DejaVuSans-2e\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#me18bf5e0a6\" y=\"27.894109\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 0.10 -->\n",
       "      <g transform=\"translate(170.255125 31.693328)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"LineCollection_1\"/>\n",
       "   <g id=\"patch_9\">\n",
       "    <path d=\"M 159.178125 106.453219 \n",
       "L 159.178125 106.134703 \n",
       "L 159.178125 25.231734 \n",
       "L 159.178125 24.913219 \n",
       "L 163.255125 24.913219 \n",
       "L 163.255125 25.231734 \n",
       "L 163.255125 106.134703 \n",
       "L 163.255125 106.453219 \n",
       "z\n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pd94640048c\">\n",
       "   <rect height=\"111.6\" width=\"111.6\" x=\"40.603125\" y=\"9.883219\"/>\n",
       "  </clipPath>\n",
       "  <clipPath id=\"p3e077ffc2a\">\n",
       "   <rect height=\"81.54\" width=\"4.077\" x=\"159.178125\" y=\"24.913219\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 180x180 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "d2l.show_heatmaps(d2l.expand_dims(d2l.expand_dims(attention_weights, 0), 0),\n",
    "                  xlabel='Sorted training inputs',\n",
    "                  ylabel='Sorted testing inputs')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "带参数注意力汇聚\n",
    "假定两个张量的形状分别是$(n,a,b)$和$(n,b,c)$，\n",
    "它们的批量矩阵乘法输出的形状为$(n,a,c)$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "origin_pos": 27,
    "tab": [
     "pytorch"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(2, 1, 6)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X = d2l.ones((2, 1, 4))\n",
    "Y = d2l.ones((2, 4, 6))\n",
    "d2l.bmm(X, Y).shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "使用小批量矩阵乘法来计算小批量数据中的加权平均值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "origin_pos": 31,
    "tab": [
     "pytorch"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Tensor(shape=[2, 1, 1], dtype=Float32, value=\n",
       "[[[ 4.50000000e+00]],\n",
       " [[ 1.45000000e+01]]])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights = d2l.ones((2, 10)) * 0.1\n",
    "values = d2l.arange(20.0).reshape((2, 10))\n",
    "d2l.bmm(d2l.expand_dims(weights, 1), d2l.expand_dims(values, -1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "带参数的注意力汇聚"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "origin_pos": 35,
    "tab": [
     "pytorch"
    ]
   },
   "outputs": [],
   "source": [
    "class NWKernelRegression(nn.Cell):\n",
    "    def __init__(self, **kwargs):\n",
    "        super().__init__(**kwargs)\n",
    "        self.w = Parameter(d2l.rand((1,)))\n",
    "\n",
    "    def construct(self, queries, keys, values):\n",
    "        # queries和attention_weights的形状为(查询个数，“键－值”对个数)\n",
    "        queries = d2l.reshape(queries.repeat(keys.shape[1]), (-1, keys.shape[1]))\n",
    "        self.attention_weights = nn.Softmax(axis=1)(\n",
    "            -((queries - keys) * self.w)**2 / 2)\n",
    "        # values的形状为(查询个数，“键－值”对个数)\n",
    "        return d2l.bmm(d2l.expand_dims(self.attention_weights, 1),\n",
    "                         d2l.expand_dims(values, -1)).reshape(-1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "将训练数据集变换为键和值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "origin_pos": 39,
    "tab": [
     "pytorch"
    ]
   },
   "outputs": [],
   "source": [
    "# X_tile的形状:(n_train，n_train)，每一行都包含着相同的训练输入\n",
    "X_tile = d2l.tile(x_train, (n_train, 1))\n",
    "# Y_tile的形状:(n_train，n_train)，每一行都包含着相同的训练输出\n",
    "Y_tile = d2l.tile(y_train, (n_train, 1))\n",
    "# keys的形状:('n_train'，'n_train'-1)\n",
    "keys = d2l.reshape(X_tile[(1 - d2l.eye(n_train)).astype(mindspore.int32)],\n",
    "                   (n_train, -1))\n",
    "# values的形状:('n_train'，'n_train'-1)\n",
    "values = d2l.reshape(Y_tile[(1 - d2l.eye(n_train)).astype(mindspore.int32)],\n",
    "                     (n_train, -1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "训练带参数的注意力汇聚模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "origin_pos": 43,
    "tab": [
     "pytorch"
    ]
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"180.65625pt\" version=\"1.1\" viewBox=\"0 0 239.921875 180.65625\" width=\"239.921875pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-11-24T11:13:07.493513</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.3, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 180.65625 \n",
       "L 239.921875 180.65625 \n",
       "L 239.921875 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 34.240625 143.1 \n",
       "L 229.540625 143.1 \n",
       "L 229.540625 7.2 \n",
       "L 34.240625 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path clip-path=\"url(#p85d1bb102f)\" d=\"M 34.240625 143.1 \n",
       "L 34.240625 7.2 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"m6a1255ba8b\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.240625\" xlink:href=\"#m6a1255ba8b\" y=\"143.1\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(31.059375 157.698438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <path clip-path=\"url(#p85d1bb102f)\" d=\"M 83.065625 143.1 \n",
       "L 83.065625 7.2 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"83.065625\" xlink:href=\"#m6a1255ba8b\" y=\"143.1\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(79.884375 157.698438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <path clip-path=\"url(#p85d1bb102f)\" d=\"M 131.890625 143.1 \n",
       "L 131.890625 7.2 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"131.890625\" xlink:href=\"#m6a1255ba8b\" y=\"143.1\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(128.709375 157.698438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path clip-path=\"url(#p85d1bb102f)\" d=\"M 180.715625 143.1 \n",
       "L 180.715625 7.2 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"180.715625\" xlink:href=\"#m6a1255ba8b\" y=\"143.1\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(177.534375 157.698438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path clip-path=\"url(#p85d1bb102f)\" d=\"M 229.540625 143.1 \n",
       "L 229.540625 7.2 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"229.540625\" xlink:href=\"#m6a1255ba8b\" y=\"143.1\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 5 -->\n",
       "      <g transform=\"translate(226.359375 157.698438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- epoch -->\n",
       "     <g transform=\"translate(116.6625 171.376563)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 3597 1894 \n",
       "L 3597 1613 \n",
       "L 953 1613 \n",
       "Q 991 1019 1311 708 \n",
       "Q 1631 397 2203 397 \n",
       "Q 2534 397 2845 478 \n",
       "Q 3156 559 3463 722 \n",
       "L 3463 178 \n",
       "Q 3153 47 2828 -22 \n",
       "Q 2503 -91 2169 -91 \n",
       "Q 1331 -91 842 396 \n",
       "Q 353 884 353 1716 \n",
       "Q 353 2575 817 3079 \n",
       "Q 1281 3584 2069 3584 \n",
       "Q 2775 3584 3186 3129 \n",
       "Q 3597 2675 3597 1894 \n",
       "z\n",
       "M 3022 2063 \n",
       "Q 3016 2534 2758 2815 \n",
       "Q 2500 3097 2075 3097 \n",
       "Q 1594 3097 1305 2825 \n",
       "Q 1016 2553 972 2059 \n",
       "L 3022 2063 \n",
       "z\n",
       "\" id=\"DejaVuSans-65\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1159 525 \n",
       "L 1159 -1331 \n",
       "L 581 -1331 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2969 \n",
       "Q 1341 3281 1617 3432 \n",
       "Q 1894 3584 2278 3584 \n",
       "Q 2916 3584 3314 3078 \n",
       "Q 3713 2572 3713 1747 \n",
       "Q 3713 922 3314 415 \n",
       "Q 2916 -91 2278 -91 \n",
       "Q 1894 -91 1617 61 \n",
       "Q 1341 213 1159 525 \n",
       "z\n",
       "M 3116 1747 \n",
       "Q 3116 2381 2855 2742 \n",
       "Q 2594 3103 2138 3103 \n",
       "Q 1681 3103 1420 2742 \n",
       "Q 1159 2381 1159 1747 \n",
       "Q 1159 1113 1420 752 \n",
       "Q 1681 391 2138 391 \n",
       "Q 2594 391 2855 752 \n",
       "Q 3116 1113 3116 1747 \n",
       "z\n",
       "\" id=\"DejaVuSans-70\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1959 3097 \n",
       "Q 1497 3097 1228 2736 \n",
       "Q 959 2375 959 1747 \n",
       "Q 959 1119 1226 758 \n",
       "Q 1494 397 1959 397 \n",
       "Q 2419 397 2687 759 \n",
       "Q 2956 1122 2956 1747 \n",
       "Q 2956 2369 2687 2733 \n",
       "Q 2419 3097 1959 3097 \n",
       "z\n",
       "M 1959 3584 \n",
       "Q 2709 3584 3137 3096 \n",
       "Q 3566 2609 3566 1747 \n",
       "Q 3566 888 3137 398 \n",
       "Q 2709 -91 1959 -91 \n",
       "Q 1206 -91 779 398 \n",
       "Q 353 888 353 1747 \n",
       "Q 353 2609 779 3096 \n",
       "Q 1206 3584 1959 3584 \n",
       "z\n",
       "\" id=\"DejaVuSans-6f\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3122 3366 \n",
       "L 3122 2828 \n",
       "Q 2878 2963 2633 3030 \n",
       "Q 2388 3097 2138 3097 \n",
       "Q 1578 3097 1268 2742 \n",
       "Q 959 2388 959 1747 \n",
       "Q 959 1106 1268 751 \n",
       "Q 1578 397 2138 397 \n",
       "Q 2388 397 2633 464 \n",
       "Q 2878 531 3122 666 \n",
       "L 3122 134 \n",
       "Q 2881 22 2623 -34 \n",
       "Q 2366 -91 2075 -91 \n",
       "Q 1284 -91 818 406 \n",
       "Q 353 903 353 1747 \n",
       "Q 353 2603 823 3093 \n",
       "Q 1294 3584 2113 3584 \n",
       "Q 2378 3584 2631 3529 \n",
       "Q 2884 3475 3122 3366 \n",
       "z\n",
       "\" id=\"DejaVuSans-63\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 4863 \n",
       "L 1159 4863 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" id=\"DejaVuSans-68\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use x=\"61.523438\" xlink:href=\"#DejaVuSans-70\"/>\n",
       "      <use x=\"125\" xlink:href=\"#DejaVuSans-6f\"/>\n",
       "      <use x=\"186.181641\" xlink:href=\"#DejaVuSans-63\"/>\n",
       "      <use x=\"241.162109\" xlink:href=\"#DejaVuSans-68\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path clip-path=\"url(#p85d1bb102f)\" d=\"M 34.240625 127.548208 \n",
       "L 229.540625 127.548208 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"mbd169819c2\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.240625\" xlink:href=\"#mbd169819c2\" y=\"127.548208\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(20.878125 131.347427)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path clip-path=\"url(#p85d1bb102f)\" d=\"M 34.240625 95.009235 \n",
       "L 229.540625 95.009235 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.240625\" xlink:href=\"#mbd169819c2\" y=\"95.009235\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(20.878125 98.808454)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path clip-path=\"url(#p85d1bb102f)\" d=\"M 34.240625 62.470261 \n",
       "L 229.540625 62.470261 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.240625\" xlink:href=\"#mbd169819c2\" y=\"62.470261\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 6 -->\n",
       "      <g transform=\"translate(20.878125 66.26948)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2113 2584 \n",
       "Q 1688 2584 1439 2293 \n",
       "Q 1191 2003 1191 1497 \n",
       "Q 1191 994 1439 701 \n",
       "Q 1688 409 2113 409 \n",
       "Q 2538 409 2786 701 \n",
       "Q 3034 994 3034 1497 \n",
       "Q 3034 2003 2786 2293 \n",
       "Q 2538 2584 2113 2584 \n",
       "z\n",
       "M 3366 4563 \n",
       "L 3366 3988 \n",
       "Q 3128 4100 2886 4159 \n",
       "Q 2644 4219 2406 4219 \n",
       "Q 1781 4219 1451 3797 \n",
       "Q 1122 3375 1075 2522 \n",
       "Q 1259 2794 1537 2939 \n",
       "Q 1816 3084 2150 3084 \n",
       "Q 2853 3084 3261 2657 \n",
       "Q 3669 2231 3669 1497 \n",
       "Q 3669 778 3244 343 \n",
       "Q 2819 -91 2113 -91 \n",
       "Q 1303 -91 875 529 \n",
       "Q 447 1150 447 2328 \n",
       "Q 447 3434 972 4092 \n",
       "Q 1497 4750 2381 4750 \n",
       "Q 2619 4750 2861 4703 \n",
       "Q 3103 4656 3366 4563 \n",
       "z\n",
       "\" id=\"DejaVuSans-36\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-36\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <path clip-path=\"url(#p85d1bb102f)\" d=\"M 34.240625 29.931288 \n",
       "L 229.540625 29.931288 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_18\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"34.240625\" xlink:href=\"#mbd169819c2\" y=\"29.931288\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 8 -->\n",
       "      <g transform=\"translate(20.878125 33.730507)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 2216 \n",
       "Q 1584 2216 1326 1975 \n",
       "Q 1069 1734 1069 1313 \n",
       "Q 1069 891 1326 650 \n",
       "Q 1584 409 2034 409 \n",
       "Q 2484 409 2743 651 \n",
       "Q 3003 894 3003 1313 \n",
       "Q 3003 1734 2745 1975 \n",
       "Q 2488 2216 2034 2216 \n",
       "z\n",
       "M 1403 2484 \n",
       "Q 997 2584 770 2862 \n",
       "Q 544 3141 544 3541 \n",
       "Q 544 4100 942 4425 \n",
       "Q 1341 4750 2034 4750 \n",
       "Q 2731 4750 3128 4425 \n",
       "Q 3525 4100 3525 3541 \n",
       "Q 3525 3141 3298 2862 \n",
       "Q 3072 2584 2669 2484 \n",
       "Q 3125 2378 3379 2068 \n",
       "Q 3634 1759 3634 1313 \n",
       "Q 3634 634 3220 271 \n",
       "Q 2806 -91 2034 -91 \n",
       "Q 1263 -91 848 271 \n",
       "Q 434 634 434 1313 \n",
       "Q 434 1759 690 2068 \n",
       "Q 947 2378 1403 2484 \n",
       "z\n",
       "M 1172 3481 \n",
       "Q 1172 3119 1398 2916 \n",
       "Q 1625 2713 2034 2713 \n",
       "Q 2441 2713 2670 2916 \n",
       "Q 2900 3119 2900 3481 \n",
       "Q 2900 3844 2670 4047 \n",
       "Q 2441 4250 2034 4250 \n",
       "Q 1625 4250 1398 4047 \n",
       "Q 1172 3844 1172 3481 \n",
       "z\n",
       "\" id=\"DejaVuSans-38\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-38\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_11\">\n",
       "     <!-- loss -->\n",
       "     <g transform=\"translate(14.798438 84.807812)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 4863 \n",
       "z\n",
       "\" id=\"DejaVuSans-6c\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2834 3397 \n",
       "L 2834 2853 \n",
       "Q 2591 2978 2328 3040 \n",
       "Q 2066 3103 1784 3103 \n",
       "Q 1356 3103 1142 2972 \n",
       "Q 928 2841 928 2578 \n",
       "Q 928 2378 1081 2264 \n",
       "Q 1234 2150 1697 2047 \n",
       "L 1894 2003 \n",
       "Q 2506 1872 2764 1633 \n",
       "Q 3022 1394 3022 966 \n",
       "Q 3022 478 2636 193 \n",
       "Q 2250 -91 1575 -91 \n",
       "Q 1294 -91 989 -36 \n",
       "Q 684 19 347 128 \n",
       "L 347 722 \n",
       "Q 666 556 975 473 \n",
       "Q 1284 391 1588 391 \n",
       "Q 1994 391 2212 530 \n",
       "Q 2431 669 2431 922 \n",
       "Q 2431 1156 2273 1281 \n",
       "Q 2116 1406 1581 1522 \n",
       "L 1381 1569 \n",
       "Q 847 1681 609 1914 \n",
       "Q 372 2147 372 2553 \n",
       "Q 372 3047 722 3315 \n",
       "Q 1072 3584 1716 3584 \n",
       "Q 2034 3584 2315 3537 \n",
       "Q 2597 3491 2834 3397 \n",
       "z\n",
       "\" id=\"DejaVuSans-73\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-6c\"/>\n",
       "      <use x=\"27.783203\" xlink:href=\"#DejaVuSans-6f\"/>\n",
       "      <use x=\"88.964844\" xlink:href=\"#DejaVuSans-73\"/>\n",
       "      <use x=\"141.064453\" xlink:href=\"#DejaVuSans-73\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_19\">\n",
       "    <path clip-path=\"url(#p85d1bb102f)\" d=\"M 34.240625 13.377273 \n",
       "L 83.065625 136.674946 \n",
       "L 131.890625 136.75865 \n",
       "L 180.715625 136.841221 \n",
       "L 229.540625 136.922727 \n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 34.240625 143.1 \n",
       "L 34.240625 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 229.540625 143.1 \n",
       "L 229.540625 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 34.240625 143.1 \n",
       "L 229.540625 143.1 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 34.240625 7.2 \n",
       "L 229.540625 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p85d1bb102f\">\n",
       "   <rect height=\"135.9\" width=\"195.3\" x=\"34.240625\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 252x180 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "net = NWKernelRegression()\n",
    "loss = nn.MSELoss(reduction='none')\n",
    "optimizer = nn.SGD(net.trainable_params(), 0.5)\n",
    "animator = d2l.Animator(xlabel='epoch', ylabel='loss', xlim=[1, 5])\n",
    "\n",
    "def train_loop(model, data, label, loss_fn, optimizer):\n",
    "    # 定义前向传播函数\n",
    "    def forward_fn(data, label):\n",
    "        logits = model(data[0], data[1], data[2])\n",
    "        loss = loss_fn(logits, label)\n",
    "        return loss\n",
    "\n",
    "    # 获取梯度函数\n",
    "    grad_fn = value_and_grad(forward_fn, None, optimizer.parameters)\n",
    "\n",
    "    # 定义模型单步训练\n",
    "    def train_one_step(data, label):\n",
    "        loss, grads = grad_fn(data, label)\n",
    "        optimizer(grads)\n",
    "        return loss\n",
    "\n",
    "    return train_one_step(data, label)\n",
    "\n",
    "for epoch in range(5):\n",
    "    l = train_loop(net, (x_train, keys, values), y_train, loss, optimizer) / 2\n",
    "    print(f'epoch {epoch + 1}, loss {float(l.sum().asnumpy()):.6f}')\n",
    "    animator.add(epoch + 1, float(l.sum().asnumpy()))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "预测结果绘制"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "origin_pos": 47,
    "tab": [
     "pytorch"
    ]
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"184.455469pt\" version=\"1.1\" viewBox=\"0 0 248.301563 184.455469\" width=\"248.301563pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-11-24T11:13:07.961575</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.3, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 184.455469 \n",
       "L 248.301563 184.455469 \n",
       "L 248.301563 -0 \n",
       "L 0 -0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 42.620312 146.899219 \n",
       "L 237.920313 146.899219 \n",
       "L 237.920313 10.999219 \n",
       "L 42.620312 10.999219 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 42.620312 146.899219 \n",
       "L 42.620312 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"mb9609eddc2\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mb9609eddc2\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(39.439062 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 81.680312 146.899219 \n",
       "L 81.680312 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"81.680312\" xlink:href=\"#mb9609eddc2\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(78.499062 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 120.740313 146.899219 \n",
       "L 120.740313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"120.740313\" xlink:href=\"#mb9609eddc2\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(117.559062 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 159.800313 146.899219 \n",
       "L 159.800313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"159.800313\" xlink:href=\"#mb9609eddc2\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(156.619063 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 198.860313 146.899219 \n",
       "L 198.860313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"198.860313\" xlink:href=\"#mb9609eddc2\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(195.679063 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 237.920313 146.899219 \n",
       "L 237.920313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"237.920313\" xlink:href=\"#mb9609eddc2\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 5 -->\n",
       "      <g transform=\"translate(234.739063 161.497656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_7\">\n",
       "     <!-- x -->\n",
       "     <g transform=\"translate(137.310937 175.175781)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 3513 3500 \n",
       "L 2247 1797 \n",
       "L 3578 0 \n",
       "L 2900 0 \n",
       "L 1881 1375 \n",
       "L 863 0 \n",
       "L 184 0 \n",
       "L 1544 1831 \n",
       "L 300 3500 \n",
       "L 978 3500 \n",
       "L 1906 2253 \n",
       "L 2834 3500 \n",
       "L 3513 3500 \n",
       "z\n",
       "\" id=\"DejaVuSans-78\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-78\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 42.620312 146.899219 \n",
       "L 237.920313 146.899219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"mbc28b23166\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbc28b23166\" y=\"146.899219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- −1 -->\n",
       "      <g transform=\"translate(20.878125 150.698437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 678 2272 \n",
       "L 4684 2272 \n",
       "L 4684 1741 \n",
       "L 678 1741 \n",
       "L 678 2272 \n",
       "z\n",
       "\" id=\"DejaVuSans-2212\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-2212\"/>\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 42.620312 124.249219 \n",
       "L 237.920313 124.249219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbc28b23166\" y=\"124.249219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(29.257812 128.048437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 42.620312 101.599219 \n",
       "L 237.920313 101.599219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_18\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbc28b23166\" y=\"101.599219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(29.257812 105.398437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 42.620312 78.949219 \n",
       "L 237.920313 78.949219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_20\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbc28b23166\" y=\"78.949219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(29.257812 82.748437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_21\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 42.620312 56.299219 \n",
       "L 237.920313 56.299219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_22\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbc28b23166\" y=\"56.299219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(29.257812 60.098437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_23\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 42.620312 33.649219 \n",
       "L 237.920313 33.649219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_24\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbc28b23166\" y=\"33.649219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(29.257812 37.448437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_25\">\n",
       "      <path clip-path=\"url(#p3c1cce7929)\" d=\"M 42.620312 10.999219 \n",
       "L 237.920313 10.999219 \n",
       "\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_26\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbc28b23166\" y=\"10.999219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 5 -->\n",
       "      <g transform=\"translate(29.257812 14.798437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_15\">\n",
       "     <!-- y -->\n",
       "     <g transform=\"translate(14.798437 81.908594)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 2059 -325 \n",
       "Q 1816 -950 1584 -1140 \n",
       "Q 1353 -1331 966 -1331 \n",
       "L 506 -1331 \n",
       "L 506 -850 \n",
       "L 844 -850 \n",
       "Q 1081 -850 1212 -737 \n",
       "Q 1344 -625 1503 -206 \n",
       "L 1606 56 \n",
       "L 191 3500 \n",
       "L 800 3500 \n",
       "L 1894 763 \n",
       "L 2988 3500 \n",
       "L 3597 3500 \n",
       "L 2059 -325 \n",
       "z\n",
       "\" id=\"DejaVuSans-79\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-79\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_27\">\n",
       "    <path clip-path=\"url(#p3c1cce7929)\" d=\"M 42.620312 124.249219 \n",
       "L 46.526313 116.136982 \n",
       "L 50.432313 108.999323 \n",
       "L 54.338313 102.217148 \n",
       "L 58.244313 95.726382 \n",
       "L 62.150312 89.522233 \n",
       "L 66.056313 83.61909 \n",
       "L 69.962312 78.038824 \n",
       "L 73.868313 72.805995 \n",
       "L 77.774314 67.9454 \n",
       "L 81.680312 63.480584 \n",
       "L 85.586313 59.432954 \n",
       "L 89.492314 55.821098 \n",
       "L 93.398315 52.660253 \n",
       "L 97.304312 49.962036 \n",
       "L 101.210313 47.734078 \n",
       "L 105.116313 45.979916 \n",
       "L 109.022314 44.698804 \n",
       "L 112.928315 43.885737 \n",
       "L 116.834312 43.531366 \n",
       "L 120.740313 43.6221 \n",
       "L 124.646318 44.140188 \n",
       "L 128.552314 45.063862 \n",
       "L 132.458311 46.367563 \n",
       "L 136.364316 48.022135 \n",
       "L 140.270312 49.995102 \n",
       "L 144.176318 52.251038 \n",
       "L 148.082314 54.751808 \n",
       "L 151.988311 57.457028 \n",
       "L 155.894316 60.324422 \n",
       "L 159.800313 63.310198 \n",
       "L 163.706318 66.369546 \n",
       "L 167.612314 69.457035 \n",
       "L 171.518311 72.527086 \n",
       "L 175.424316 75.534393 \n",
       "L 179.330312 78.434376 \n",
       "L 183.236318 81.183649 \n",
       "L 187.142314 83.740421 \n",
       "L 191.048311 86.06491 \n",
       "L 194.954316 88.119776 \n",
       "L 198.860313 89.870418 \n",
       "L 202.766309 91.285373 \n",
       "L 206.672324 92.336626 \n",
       "L 210.57832 92.999866 \n",
       "L 214.484316 93.254724 \n",
       "L 218.390312 93.084991 \n",
       "L 222.296309 92.478762 \n",
       "L 226.202324 91.428564 \n",
       "L 230.10832 89.931456 \n",
       "L 234.014316 87.988968 \n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_28\">\n",
       "    <path clip-path=\"url(#p3c1cce7929)\" d=\"M 42.620312 126.985634 \n",
       "L 46.526313 121.050935 \n",
       "L 50.432313 110.01 \n",
       "L 54.338313 99.471747 \n",
       "L 58.244313 96.169618 \n",
       "L 62.150312 100.729406 \n",
       "L 66.056313 99.123052 \n",
       "L 69.962312 67.73354 \n",
       "L 73.868313 58.07469 \n",
       "L 77.774314 63.031613 \n",
       "L 81.680312 68.026786 \n",
       "L 85.586313 64.658747 \n",
       "L 89.492314 61.149769 \n",
       "L 93.398315 46.603848 \n",
       "L 97.304312 45.517655 \n",
       "L 101.210313 44.248672 \n",
       "L 105.116313 40.805052 \n",
       "L 109.022314 35.104006 \n",
       "L 112.928315 40.5072 \n",
       "L 116.834312 47.774396 \n",
       "L 120.740313 48.135344 \n",
       "L 124.646318 46.161033 \n",
       "L 128.552314 53.27103 \n",
       "L 132.458311 44.52784 \n",
       "L 136.364316 38.271536 \n",
       "L 140.270312 44.956015 \n",
       "L 144.176318 52.888162 \n",
       "L 148.082314 58.90358 \n",
       "L 151.988311 62.954364 \n",
       "L 155.894316 65.469088 \n",
       "L 159.800313 63.237139 \n",
       "L 163.706318 64.867351 \n",
       "L 167.612314 77.069378 \n",
       "L 171.518311 72.423386 \n",
       "L 175.424316 63.629462 \n",
       "L 179.330312 70.257352 \n",
       "L 183.236318 84.214981 \n",
       "L 187.142314 91.758267 \n",
       "L 191.048311 100.112573 \n",
       "L 194.954316 100.874987 \n",
       "L 198.860313 100.801877 \n",
       "L 202.766309 89.321052 \n",
       "L 206.672324 81.071725 \n",
       "L 210.57832 87.837895 \n",
       "L 214.484316 91.801144 \n",
       "L 218.390312 99.356559 \n",
       "L 222.296309 104.207013 \n",
       "L 226.202324 99.473807 \n",
       "L 230.10832 90.416554 \n",
       "L 234.014316 87.284646 \n",
       "\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_29\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 3 \n",
       "C 0.795609 3 1.55874 2.683901 2.12132 2.12132 \n",
       "C 2.683901 1.55874 3 0.795609 3 0 \n",
       "C 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \n",
       "C 1.55874 -2.683901 0.795609 -3 0 -3 \n",
       "C -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \n",
       "C -2.683901 -1.55874 -3 -0.795609 -3 0 \n",
       "C -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \n",
       "C -1.55874 2.683901 -0.795609 3 0 3 \n",
       "z\n",
       "\" id=\"mb759d0759c\" style=\"stroke:#ff7f0e;stroke-opacity:0.5;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p3c1cce7929)\">\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"46.200385\" xlink:href=\"#mb759d0759c\" y=\"132.583698\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"47.924768\" xlink:href=\"#mb759d0759c\" y=\"113.325927\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"50.623843\" xlink:href=\"#mb759d0759c\" y=\"117.179436\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"52.458427\" xlink:href=\"#mb759d0759c\" y=\"88.557466\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"64.520449\" xlink:href=\"#mb759d0759c\" y=\"100.786084\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"73.26929\" xlink:href=\"#mb759d0759c\" y=\"57.854444\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"82.916341\" xlink:href=\"#mb759d0759c\" y=\"70.948343\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"85.728853\" xlink:href=\"#mb759d0759c\" y=\"60.691477\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"96.96157\" xlink:href=\"#mb759d0759c\" y=\"45.889798\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"102.040585\" xlink:href=\"#mb759d0759c\" y=\"47.581286\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"102.522308\" xlink:href=\"#mb759d0759c\" y=\"40.568492\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"108.279087\" xlink:href=\"#mb759d0759c\" y=\"33.989441\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"115.219381\" xlink:href=\"#mb759d0759c\" y=\"23.368117\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"115.403496\" xlink:href=\"#mb759d0759c\" y=\"35.860452\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"116.265044\" xlink:href=\"#mb759d0759c\" y=\"59.176532\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"117.878802\" xlink:href=\"#mb759d0759c\" y=\"58.52277\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"117.950756\" xlink:href=\"#mb759d0759c\" y=\"61.61007\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"121.239833\" xlink:href=\"#mb759d0759c\" y=\"42.719978\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"122.097768\" xlink:href=\"#mb759d0759c\" y=\"37.86042\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"123.054911\" xlink:href=\"#mb759d0759c\" y=\"51.738939\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"131.102122\" xlink:href=\"#mb759d0759c\" y=\"58.714363\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"134.89429\" xlink:href=\"#mb759d0759c\" y=\"28.899414\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"136.853732\" xlink:href=\"#mb759d0759c\" y=\"37.786524\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"139.789175\" xlink:href=\"#mb759d0759c\" y=\"42.523222\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"140.606377\" xlink:href=\"#mb759d0759c\" y=\"46.500072\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"143.549103\" xlink:href=\"#mb759d0759c\" y=\"55.042138\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"145.754241\" xlink:href=\"#mb759d0759c\" y=\"55.526777\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"149.165103\" xlink:href=\"#mb759d0759c\" y=\"62.679365\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"152.964367\" xlink:href=\"#mb759d0759c\" y=\"58.149683\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"154.910036\" xlink:href=\"#mb759d0759c\" y=\"70.294111\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"157.887834\" xlink:href=\"#mb759d0759c\" y=\"74.553083\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"158.961533\" xlink:href=\"#mb759d0759c\" y=\"79.038216\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"159.226766\" xlink:href=\"#mb759d0759c\" y=\"49.688004\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"159.712662\" xlink:href=\"#mb759d0759c\" y=\"46.846353\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"161.561051\" xlink:href=\"#mb759d0759c\" y=\"68.438166\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"168.815553\" xlink:href=\"#mb759d0759c\" y=\"82.72152\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"170.925701\" xlink:href=\"#mb759d0759c\" y=\"70.606253\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"175.354285\" xlink:href=\"#mb759d0759c\" y=\"60.421674\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"183.945298\" xlink:href=\"#mb759d0759c\" y=\"84.203227\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"190.719342\" xlink:href=\"#mb759d0759c\" y=\"100.673936\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"197.658033\" xlink:href=\"#mb759d0759c\" y=\"100.987988\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"207.486527\" xlink:href=\"#mb759d0759c\" y=\"80.187496\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"213.694996\" xlink:href=\"#mb759d0759c\" y=\"96.813843\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"214.969281\" xlink:href=\"#mb759d0759c\" y=\"84.854198\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"215.353743\" xlink:href=\"#mb759d0759c\" y=\"87.307127\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"218.737953\" xlink:href=\"#mb759d0759c\" y=\"104.332631\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"219.697191\" xlink:href=\"#mb759d0759c\" y=\"106.237449\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"221.852022\" xlink:href=\"#mb759d0759c\" y=\"105.617372\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"225.762842\" xlink:href=\"#mb759d0759c\" y=\"102.072125\"/>\n",
       "     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"230.026238\" xlink:href=\"#mb759d0759c\" y=\"86.774461\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 42.620312 146.899219 \n",
       "L 42.620312 10.999219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 237.920313 146.899219 \n",
       "L 237.920313 10.999219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 42.620312 146.899219 \n",
       "L 237.920313 146.899219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 42.620312 10.999219 \n",
       "L 237.920313 10.999219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"patch_7\">\n",
       "     <path d=\"M 173.58125 48.355469 \n",
       "L 230.920313 48.355469 \n",
       "Q 232.920313 48.355469 232.920313 46.355469 \n",
       "L 232.920313 17.999219 \n",
       "Q 232.920313 15.999219 230.920313 15.999219 \n",
       "L 173.58125 15.999219 \n",
       "Q 171.58125 15.999219 171.58125 17.999219 \n",
       "L 171.58125 46.355469 \n",
       "Q 171.58125 48.355469 173.58125 48.355469 \n",
       "z\n",
       "\" style=\"fill:#ffffff;opacity:0.8;stroke:#cccccc;stroke-linejoin:miter;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_30\">\n",
       "     <path d=\"M 175.58125 24.097656 \n",
       "L 195.58125 24.097656 \n",
       "\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_31\"/>\n",
       "    <g id=\"text_16\">\n",
       "     <!-- Truth -->\n",
       "     <g transform=\"translate(203.58125 27.597656)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M -19 4666 \n",
       "L 3928 4666 \n",
       "L 3928 4134 \n",
       "L 2272 4134 \n",
       "L 2272 0 \n",
       "L 1638 0 \n",
       "L 1638 4134 \n",
       "L -19 4134 \n",
       "L -19 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-54\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2631 2963 \n",
       "Q 2534 3019 2420 3045 \n",
       "Q 2306 3072 2169 3072 \n",
       "Q 1681 3072 1420 2755 \n",
       "Q 1159 2438 1159 1844 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1341 3275 1631 3429 \n",
       "Q 1922 3584 2338 3584 \n",
       "Q 2397 3584 2469 3576 \n",
       "Q 2541 3569 2628 3553 \n",
       "L 2631 2963 \n",
       "z\n",
       "\" id=\"DejaVuSans-72\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 544 1381 \n",
       "L 544 3500 \n",
       "L 1119 3500 \n",
       "L 1119 1403 \n",
       "Q 1119 906 1312 657 \n",
       "Q 1506 409 1894 409 \n",
       "Q 2359 409 2629 706 \n",
       "Q 2900 1003 2900 1516 \n",
       "L 2900 3500 \n",
       "L 3475 3500 \n",
       "L 3475 0 \n",
       "L 2900 0 \n",
       "L 2900 538 \n",
       "Q 2691 219 2414 64 \n",
       "Q 2138 -91 1772 -91 \n",
       "Q 1169 -91 856 284 \n",
       "Q 544 659 544 1381 \n",
       "z\n",
       "M 1991 3584 \n",
       "L 1991 3584 \n",
       "z\n",
       "\" id=\"DejaVuSans-75\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1172 4494 \n",
       "L 1172 3500 \n",
       "L 2356 3500 \n",
       "L 2356 3053 \n",
       "L 1172 3053 \n",
       "L 1172 1153 \n",
       "Q 1172 725 1289 603 \n",
       "Q 1406 481 1766 481 \n",
       "L 2356 481 \n",
       "L 2356 0 \n",
       "L 1766 0 \n",
       "Q 1100 0 847 248 \n",
       "Q 594 497 594 1153 \n",
       "L 594 3053 \n",
       "L 172 3053 \n",
       "L 172 3500 \n",
       "L 594 3500 \n",
       "L 594 4494 \n",
       "L 1172 4494 \n",
       "z\n",
       "\" id=\"DejaVuSans-74\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 4863 \n",
       "L 1159 4863 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" id=\"DejaVuSans-68\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-54\"/>\n",
       "      <use x=\"46.333984\" xlink:href=\"#DejaVuSans-72\"/>\n",
       "      <use x=\"87.447266\" xlink:href=\"#DejaVuSans-75\"/>\n",
       "      <use x=\"150.826172\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"190.035156\" xlink:href=\"#DejaVuSans-68\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_32\">\n",
       "     <path d=\"M 175.58125 38.775781 \n",
       "L 195.58125 38.775781 \n",
       "\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_33\"/>\n",
       "    <g id=\"text_17\">\n",
       "     <!-- Pred -->\n",
       "     <g transform=\"translate(203.58125 42.275781)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 1259 4147 \n",
       "L 1259 2394 \n",
       "L 2053 2394 \n",
       "Q 2494 2394 2734 2622 \n",
       "Q 2975 2850 2975 3272 \n",
       "Q 2975 3691 2734 3919 \n",
       "Q 2494 4147 2053 4147 \n",
       "L 1259 4147 \n",
       "z\n",
       "M 628 4666 \n",
       "L 2053 4666 \n",
       "Q 2838 4666 3239 4311 \n",
       "Q 3641 3956 3641 3272 \n",
       "Q 3641 2581 3239 2228 \n",
       "Q 2838 1875 2053 1875 \n",
       "L 1259 1875 \n",
       "L 1259 0 \n",
       "L 628 0 \n",
       "L 628 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-50\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3597 1894 \n",
       "L 3597 1613 \n",
       "L 953 1613 \n",
       "Q 991 1019 1311 708 \n",
       "Q 1631 397 2203 397 \n",
       "Q 2534 397 2845 478 \n",
       "Q 3156 559 3463 722 \n",
       "L 3463 178 \n",
       "Q 3153 47 2828 -22 \n",
       "Q 2503 -91 2169 -91 \n",
       "Q 1331 -91 842 396 \n",
       "Q 353 884 353 1716 \n",
       "Q 353 2575 817 3079 \n",
       "Q 1281 3584 2069 3584 \n",
       "Q 2775 3584 3186 3129 \n",
       "Q 3597 2675 3597 1894 \n",
       "z\n",
       "M 3022 2063 \n",
       "Q 3016 2534 2758 2815 \n",
       "Q 2500 3097 2075 3097 \n",
       "Q 1594 3097 1305 2825 \n",
       "Q 1016 2553 972 2059 \n",
       "L 3022 2063 \n",
       "z\n",
       "\" id=\"DejaVuSans-65\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2906 2969 \n",
       "L 2906 4863 \n",
       "L 3481 4863 \n",
       "L 3481 0 \n",
       "L 2906 0 \n",
       "L 2906 525 \n",
       "Q 2725 213 2448 61 \n",
       "Q 2172 -91 1784 -91 \n",
       "Q 1150 -91 751 415 \n",
       "Q 353 922 353 1747 \n",
       "Q 353 2572 751 3078 \n",
       "Q 1150 3584 1784 3584 \n",
       "Q 2172 3584 2448 3432 \n",
       "Q 2725 3281 2906 2969 \n",
       "z\n",
       "M 947 1747 \n",
       "Q 947 1113 1208 752 \n",
       "Q 1469 391 1925 391 \n",
       "Q 2381 391 2643 752 \n",
       "Q 2906 1113 2906 1747 \n",
       "Q 2906 2381 2643 2742 \n",
       "Q 2381 3103 1925 3103 \n",
       "Q 1469 3103 1208 2742 \n",
       "Q 947 2381 947 1747 \n",
       "z\n",
       "\" id=\"DejaVuSans-64\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-50\"/>\n",
       "      <use x=\"58.552734\" xlink:href=\"#DejaVuSans-72\"/>\n",
       "      <use x=\"97.416016\" xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use x=\"158.939453\" xlink:href=\"#DejaVuSans-64\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p3c1cce7929\">\n",
       "   <rect height=\"135.9\" width=\"195.3\" x=\"42.620312\" y=\"10.999219\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 252x180 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# keys的形状:(n_test，n_train)，每一行包含着相同的训练输入（例如，相同的键）\n",
    "keys = d2l.tile(x_train, (n_test, 1))\n",
    "# value的形状:(n_test，n_train)\n",
    "values = d2l.tile(y_train, (n_test, 1))\n",
    "y_hat = d2l.expand_dims(net(x_test, keys, values), 1)\n",
    "plot_kernel_reg(y_hat)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "曲线在注意力权重较大的区域变得更不平滑"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "origin_pos": 51,
    "tab": [
     "pytorch"
    ]
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"159.039469pt\" version=\"1.1\" viewBox=\"0 0 199.72075 159.039469\" width=\"199.72075pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-11-24T11:13:08.245674</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.3, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 159.039469 \n",
       "L 199.72075 159.039469 \n",
       "L 199.72075 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 40.603125 121.483219 \n",
       "L 152.203125 121.483219 \n",
       "L 152.203125 9.883219 \n",
       "L 40.603125 9.883219 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g clip-path=\"url(#pcd4654d116)\">\n",
       "    <image height=\"112\" id=\"image8174dd58ce\" transform=\"scale(1 -1)translate(0 -112)\" width=\"112\" x=\"40.603125\" xlink:href=\"data:image/png;base64,\n",
       "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\" y=\"-9.483219\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"meca06f5bd4\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"41.719125\" xlink:href=\"#meca06f5bd4\" y=\"121.483219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(38.537875 136.081656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"86.359125\" xlink:href=\"#meca06f5bd4\" y=\"121.483219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 20 -->\n",
       "      <g transform=\"translate(79.996625 136.081656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"130.999125\" xlink:href=\"#meca06f5bd4\" y=\"121.483219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 40 -->\n",
       "      <g transform=\"translate(124.636625 136.081656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_4\">\n",
       "     <!-- Sorted training inputs -->\n",
       "     <g transform=\"translate(41.889844 149.759781)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 3425 4513 \n",
       "L 3425 3897 \n",
       "Q 3066 4069 2747 4153 \n",
       "Q 2428 4238 2131 4238 \n",
       "Q 1616 4238 1336 4038 \n",
       "Q 1056 3838 1056 3469 \n",
       "Q 1056 3159 1242 3001 \n",
       "Q 1428 2844 1947 2747 \n",
       "L 2328 2669 \n",
       "Q 3034 2534 3370 2195 \n",
       "Q 3706 1856 3706 1288 \n",
       "Q 3706 609 3251 259 \n",
       "Q 2797 -91 1919 -91 \n",
       "Q 1588 -91 1214 -16 \n",
       "Q 841 59 441 206 \n",
       "L 441 856 \n",
       "Q 825 641 1194 531 \n",
       "Q 1563 422 1919 422 \n",
       "Q 2459 422 2753 634 \n",
       "Q 3047 847 3047 1241 \n",
       "Q 3047 1584 2836 1778 \n",
       "Q 2625 1972 2144 2069 \n",
       "L 1759 2144 \n",
       "Q 1053 2284 737 2584 \n",
       "Q 422 2884 422 3419 \n",
       "Q 422 4038 858 4394 \n",
       "Q 1294 4750 2059 4750 \n",
       "Q 2388 4750 2728 4690 \n",
       "Q 3069 4631 3425 4513 \n",
       "z\n",
       "\" id=\"DejaVuSans-53\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1959 3097 \n",
       "Q 1497 3097 1228 2736 \n",
       "Q 959 2375 959 1747 \n",
       "Q 959 1119 1226 758 \n",
       "Q 1494 397 1959 397 \n",
       "Q 2419 397 2687 759 \n",
       "Q 2956 1122 2956 1747 \n",
       "Q 2956 2369 2687 2733 \n",
       "Q 2419 3097 1959 3097 \n",
       "z\n",
       "M 1959 3584 \n",
       "Q 2709 3584 3137 3096 \n",
       "Q 3566 2609 3566 1747 \n",
       "Q 3566 888 3137 398 \n",
       "Q 2709 -91 1959 -91 \n",
       "Q 1206 -91 779 398 \n",
       "Q 353 888 353 1747 \n",
       "Q 353 2609 779 3096 \n",
       "Q 1206 3584 1959 3584 \n",
       "z\n",
       "\" id=\"DejaVuSans-6f\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2631 2963 \n",
       "Q 2534 3019 2420 3045 \n",
       "Q 2306 3072 2169 3072 \n",
       "Q 1681 3072 1420 2755 \n",
       "Q 1159 2438 1159 1844 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1341 3275 1631 3429 \n",
       "Q 1922 3584 2338 3584 \n",
       "Q 2397 3584 2469 3576 \n",
       "Q 2541 3569 2628 3553 \n",
       "L 2631 2963 \n",
       "z\n",
       "\" id=\"DejaVuSans-72\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1172 4494 \n",
       "L 1172 3500 \n",
       "L 2356 3500 \n",
       "L 2356 3053 \n",
       "L 1172 3053 \n",
       "L 1172 1153 \n",
       "Q 1172 725 1289 603 \n",
       "Q 1406 481 1766 481 \n",
       "L 2356 481 \n",
       "L 2356 0 \n",
       "L 1766 0 \n",
       "Q 1100 0 847 248 \n",
       "Q 594 497 594 1153 \n",
       "L 594 3053 \n",
       "L 172 3053 \n",
       "L 172 3500 \n",
       "L 594 3500 \n",
       "L 594 4494 \n",
       "L 1172 4494 \n",
       "z\n",
       "\" id=\"DejaVuSans-74\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3597 1894 \n",
       "L 3597 1613 \n",
       "L 953 1613 \n",
       "Q 991 1019 1311 708 \n",
       "Q 1631 397 2203 397 \n",
       "Q 2534 397 2845 478 \n",
       "Q 3156 559 3463 722 \n",
       "L 3463 178 \n",
       "Q 3153 47 2828 -22 \n",
       "Q 2503 -91 2169 -91 \n",
       "Q 1331 -91 842 396 \n",
       "Q 353 884 353 1716 \n",
       "Q 353 2575 817 3079 \n",
       "Q 1281 3584 2069 3584 \n",
       "Q 2775 3584 3186 3129 \n",
       "Q 3597 2675 3597 1894 \n",
       "z\n",
       "M 3022 2063 \n",
       "Q 3016 2534 2758 2815 \n",
       "Q 2500 3097 2075 3097 \n",
       "Q 1594 3097 1305 2825 \n",
       "Q 1016 2553 972 2059 \n",
       "L 3022 2063 \n",
       "z\n",
       "\" id=\"DejaVuSans-65\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2906 2969 \n",
       "L 2906 4863 \n",
       "L 3481 4863 \n",
       "L 3481 0 \n",
       "L 2906 0 \n",
       "L 2906 525 \n",
       "Q 2725 213 2448 61 \n",
       "Q 2172 -91 1784 -91 \n",
       "Q 1150 -91 751 415 \n",
       "Q 353 922 353 1747 \n",
       "Q 353 2572 751 3078 \n",
       "Q 1150 3584 1784 3584 \n",
       "Q 2172 3584 2448 3432 \n",
       "Q 2725 3281 2906 2969 \n",
       "z\n",
       "M 947 1747 \n",
       "Q 947 1113 1208 752 \n",
       "Q 1469 391 1925 391 \n",
       "Q 2381 391 2643 752 \n",
       "Q 2906 1113 2906 1747 \n",
       "Q 2906 2381 2643 2742 \n",
       "Q 2381 3103 1925 3103 \n",
       "Q 1469 3103 1208 2742 \n",
       "Q 947 2381 947 1747 \n",
       "z\n",
       "\" id=\"DejaVuSans-64\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-20\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2194 1759 \n",
       "Q 1497 1759 1228 1600 \n",
       "Q 959 1441 959 1056 \n",
       "Q 959 750 1161 570 \n",
       "Q 1363 391 1709 391 \n",
       "Q 2188 391 2477 730 \n",
       "Q 2766 1069 2766 1631 \n",
       "L 2766 1759 \n",
       "L 2194 1759 \n",
       "z\n",
       "M 3341 1997 \n",
       "L 3341 0 \n",
       "L 2766 0 \n",
       "L 2766 531 \n",
       "Q 2569 213 2275 61 \n",
       "Q 1981 -91 1556 -91 \n",
       "Q 1019 -91 701 211 \n",
       "Q 384 513 384 1019 \n",
       "Q 384 1609 779 1909 \n",
       "Q 1175 2209 1959 2209 \n",
       "L 2766 2209 \n",
       "L 2766 2266 \n",
       "Q 2766 2663 2505 2880 \n",
       "Q 2244 3097 1772 3097 \n",
       "Q 1472 3097 1187 3025 \n",
       "Q 903 2953 641 2809 \n",
       "L 641 3341 \n",
       "Q 956 3463 1253 3523 \n",
       "Q 1550 3584 1831 3584 \n",
       "Q 2591 3584 2966 3190 \n",
       "Q 3341 2797 3341 1997 \n",
       "z\n",
       "\" id=\"DejaVuSans-61\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 603 3500 \n",
       "L 1178 3500 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 3500 \n",
       "z\n",
       "M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 4134 \n",
       "L 603 4134 \n",
       "L 603 4863 \n",
       "z\n",
       "\" id=\"DejaVuSans-69\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" id=\"DejaVuSans-6e\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2906 1791 \n",
       "Q 2906 2416 2648 2759 \n",
       "Q 2391 3103 1925 3103 \n",
       "Q 1463 3103 1205 2759 \n",
       "Q 947 2416 947 1791 \n",
       "Q 947 1169 1205 825 \n",
       "Q 1463 481 1925 481 \n",
       "Q 2391 481 2648 825 \n",
       "Q 2906 1169 2906 1791 \n",
       "z\n",
       "M 3481 434 \n",
       "Q 3481 -459 3084 -895 \n",
       "Q 2688 -1331 1869 -1331 \n",
       "Q 1566 -1331 1297 -1286 \n",
       "Q 1028 -1241 775 -1147 \n",
       "L 775 -588 \n",
       "Q 1028 -725 1275 -790 \n",
       "Q 1522 -856 1778 -856 \n",
       "Q 2344 -856 2625 -561 \n",
       "Q 2906 -266 2906 331 \n",
       "L 2906 616 \n",
       "Q 2728 306 2450 153 \n",
       "Q 2172 0 1784 0 \n",
       "Q 1141 0 747 490 \n",
       "Q 353 981 353 1791 \n",
       "Q 353 2603 747 3093 \n",
       "Q 1141 3584 1784 3584 \n",
       "Q 2172 3584 2450 3431 \n",
       "Q 2728 3278 2906 2969 \n",
       "L 2906 3500 \n",
       "L 3481 3500 \n",
       "L 3481 434 \n",
       "z\n",
       "\" id=\"DejaVuSans-67\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1159 525 \n",
       "L 1159 -1331 \n",
       "L 581 -1331 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2969 \n",
       "Q 1341 3281 1617 3432 \n",
       "Q 1894 3584 2278 3584 \n",
       "Q 2916 3584 3314 3078 \n",
       "Q 3713 2572 3713 1747 \n",
       "Q 3713 922 3314 415 \n",
       "Q 2916 -91 2278 -91 \n",
       "Q 1894 -91 1617 61 \n",
       "Q 1341 213 1159 525 \n",
       "z\n",
       "M 3116 1747 \n",
       "Q 3116 2381 2855 2742 \n",
       "Q 2594 3103 2138 3103 \n",
       "Q 1681 3103 1420 2742 \n",
       "Q 1159 2381 1159 1747 \n",
       "Q 1159 1113 1420 752 \n",
       "Q 1681 391 2138 391 \n",
       "Q 2594 391 2855 752 \n",
       "Q 3116 1113 3116 1747 \n",
       "z\n",
       "\" id=\"DejaVuSans-70\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 544 1381 \n",
       "L 544 3500 \n",
       "L 1119 3500 \n",
       "L 1119 1403 \n",
       "Q 1119 906 1312 657 \n",
       "Q 1506 409 1894 409 \n",
       "Q 2359 409 2629 706 \n",
       "Q 2900 1003 2900 1516 \n",
       "L 2900 3500 \n",
       "L 3475 3500 \n",
       "L 3475 0 \n",
       "L 2900 0 \n",
       "L 2900 538 \n",
       "Q 2691 219 2414 64 \n",
       "Q 2138 -91 1772 -91 \n",
       "Q 1169 -91 856 284 \n",
       "Q 544 659 544 1381 \n",
       "z\n",
       "M 1991 3584 \n",
       "L 1991 3584 \n",
       "z\n",
       "\" id=\"DejaVuSans-75\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2834 3397 \n",
       "L 2834 2853 \n",
       "Q 2591 2978 2328 3040 \n",
       "Q 2066 3103 1784 3103 \n",
       "Q 1356 3103 1142 2972 \n",
       "Q 928 2841 928 2578 \n",
       "Q 928 2378 1081 2264 \n",
       "Q 1234 2150 1697 2047 \n",
       "L 1894 2003 \n",
       "Q 2506 1872 2764 1633 \n",
       "Q 3022 1394 3022 966 \n",
       "Q 3022 478 2636 193 \n",
       "Q 2250 -91 1575 -91 \n",
       "Q 1294 -91 989 -36 \n",
       "Q 684 19 347 128 \n",
       "L 347 722 \n",
       "Q 666 556 975 473 \n",
       "Q 1284 391 1588 391 \n",
       "Q 1994 391 2212 530 \n",
       "Q 2431 669 2431 922 \n",
       "Q 2431 1156 2273 1281 \n",
       "Q 2116 1406 1581 1522 \n",
       "L 1381 1569 \n",
       "Q 847 1681 609 1914 \n",
       "Q 372 2147 372 2553 \n",
       "Q 372 3047 722 3315 \n",
       "Q 1072 3584 1716 3584 \n",
       "Q 2034 3584 2315 3537 \n",
       "Q 2597 3491 2834 3397 \n",
       "z\n",
       "\" id=\"DejaVuSans-73\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-53\"/>\n",
       "      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-6f\"/>\n",
       "      <use x=\"124.658203\" xlink:href=\"#DejaVuSans-72\"/>\n",
       "      <use x=\"165.771484\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"204.980469\" xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use x=\"266.503906\" xlink:href=\"#DejaVuSans-64\"/>\n",
       "      <use x=\"329.980469\" xlink:href=\"#DejaVuSans-20\"/>\n",
       "      <use x=\"361.767578\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"400.976562\" xlink:href=\"#DejaVuSans-72\"/>\n",
       "      <use x=\"442.089844\" xlink:href=\"#DejaVuSans-61\"/>\n",
       "      <use x=\"503.369141\" xlink:href=\"#DejaVuSans-69\"/>\n",
       "      <use x=\"531.152344\" xlink:href=\"#DejaVuSans-6e\"/>\n",
       "      <use x=\"594.53125\" xlink:href=\"#DejaVuSans-69\"/>\n",
       "      <use x=\"622.314453\" xlink:href=\"#DejaVuSans-6e\"/>\n",
       "      <use x=\"685.693359\" xlink:href=\"#DejaVuSans-67\"/>\n",
       "      <use x=\"749.169922\" xlink:href=\"#DejaVuSans-20\"/>\n",
       "      <use x=\"780.957031\" xlink:href=\"#DejaVuSans-69\"/>\n",
       "      <use x=\"808.740234\" xlink:href=\"#DejaVuSans-6e\"/>\n",
       "      <use x=\"872.119141\" xlink:href=\"#DejaVuSans-70\"/>\n",
       "      <use x=\"935.595703\" xlink:href=\"#DejaVuSans-75\"/>\n",
       "      <use x=\"998.974609\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"1038.183594\" xlink:href=\"#DejaVuSans-73\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"m19b5cfe717\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m19b5cfe717\" y=\"10.999219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(27.240625 14.798437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m19b5cfe717\" y=\"33.319219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 10 -->\n",
       "      <g transform=\"translate(20.878125 37.118437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m19b5cfe717\" y=\"55.639219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 20 -->\n",
       "      <g transform=\"translate(20.878125 59.438437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m19b5cfe717\" y=\"77.959219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 30 -->\n",
       "      <g transform=\"translate(20.878125 81.758437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m19b5cfe717\" y=\"100.279219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 40 -->\n",
       "      <g transform=\"translate(20.878125 104.078437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_10\">\n",
       "     <!-- Sorted testing inputs -->\n",
       "     <g transform=\"translate(14.798438 118.160562)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSans-53\"/>\n",
       "      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-6f\"/>\n",
       "      <use x=\"124.658203\" xlink:href=\"#DejaVuSans-72\"/>\n",
       "      <use x=\"165.771484\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"204.980469\" xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use x=\"266.503906\" xlink:href=\"#DejaVuSans-64\"/>\n",
       "      <use x=\"329.980469\" xlink:href=\"#DejaVuSans-20\"/>\n",
       "      <use x=\"361.767578\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"400.976562\" xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use x=\"462.5\" xlink:href=\"#DejaVuSans-73\"/>\n",
       "      <use x=\"514.599609\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"553.808594\" xlink:href=\"#DejaVuSans-69\"/>\n",
       "      <use x=\"581.591797\" xlink:href=\"#DejaVuSans-6e\"/>\n",
       "      <use x=\"644.970703\" xlink:href=\"#DejaVuSans-67\"/>\n",
       "      <use x=\"708.447266\" xlink:href=\"#DejaVuSans-20\"/>\n",
       "      <use x=\"740.234375\" xlink:href=\"#DejaVuSans-69\"/>\n",
       "      <use x=\"768.017578\" xlink:href=\"#DejaVuSans-6e\"/>\n",
       "      <use x=\"831.396484\" xlink:href=\"#DejaVuSans-70\"/>\n",
       "      <use x=\"894.873047\" xlink:href=\"#DejaVuSans-75\"/>\n",
       "      <use x=\"958.251953\" xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use x=\"997.460938\" xlink:href=\"#DejaVuSans-73\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 40.603125 121.483219 \n",
       "L 40.603125 9.883219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 152.203125 121.483219 \n",
       "L 152.203125 9.883219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 40.603125 121.483219 \n",
       "L 152.203125 121.483219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 40.603125 9.883219 \n",
       "L 152.203125 9.883219 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       "  <g id=\"axes_2\">\n",
       "   <g id=\"patch_7\">\n",
       "    <path d=\"M 159.178125 106.453219 \n",
       "L 163.255125 106.453219 \n",
       "L 163.255125 24.913219 \n",
       "L 159.178125 24.913219 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_8\">\n",
       "    <path clip-path=\"url(#p7c654ff9ff)\" d=\"M 159.178125 106.453219 \n",
       "L 159.178125 106.134703 \n",
       "L 159.178125 25.231734 \n",
       "L 159.178125 24.913219 \n",
       "L 163.255125 24.913219 \n",
       "L 163.255125 25.231734 \n",
       "L 163.255125 106.134703 \n",
       "L 163.255125 106.453219 \n",
       "L 163.255125 106.453219 \n",
       "z\n",
       "\" style=\"fill:#ffffff;stroke:#ffffff;stroke-linejoin:miter;stroke-width:0.01;\"/>\n",
       "   </g>\n",
       "   <image height=\"81\" id=\"imagea8a41e2a1f\" transform=\"scale(1 -1)translate(0 -81)\" width=\"4\" x=\"159\" xlink:href=\"data:image/png;base64,\n",
       "iVBORw0KGgoAAAANSUhEUgAAAAQAAABRCAYAAAD1sgc6AAAAnklEQVR4nJ2Suw7CQAwEjZT//1QqCnR+0XKzJxmSLqPx7krJo1/Ptq/nsgzbQRVBDqBH4wCkhTtkWDhqR8OSIHjii6H/Z2jtaLD2EDpm3DCkNvldftgB0GJIqM/TBfAfE+AAJcaSpZJRg1Fs0QyCjN5BRA0gkycEmTyRFhox7simsb/blSbGDWCDcdgB4MxwGu8CWAJ4shgqJ9IiBms/jwXJt9gA8G4AAAAASUVORK5CYII=\" y=\"-25\"/>\n",
       "   <g id=\"matplotlib.axis_3\"/>\n",
       "   <g id=\"matplotlib.axis_4\">\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 3.5 0 \n",
       "\" id=\"m4d7c2634e4\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m4d7c2634e4\" y=\"106.453219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 0.00 -->\n",
       "      <g transform=\"translate(170.255125 110.252437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 684 794 \n",
       "L 1344 794 \n",
       "L 1344 0 \n",
       "L 684 0 \n",
       "L 684 794 \n",
       "z\n",
       "\" id=\"DejaVuSans-2e\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m4d7c2634e4\" y=\"85.985311\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 0.25 -->\n",
       "      <g transform=\"translate(170.255125 89.78453)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_8\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m4d7c2634e4\" y=\"65.517404\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 0.50 -->\n",
       "      <g transform=\"translate(170.255125 69.316622)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_9\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m4d7c2634e4\" y=\"45.049496\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 0.75 -->\n",
       "      <g transform=\"translate(170.255125 48.848715)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 525 4666 \n",
       "L 3525 4666 \n",
       "L 3525 4397 \n",
       "L 1831 0 \n",
       "L 1172 0 \n",
       "L 2766 4134 \n",
       "L 525 4134 \n",
       "L 525 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-37\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-37\"/>\n",
       "       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"LineCollection_1\"/>\n",
       "   <g id=\"patch_9\">\n",
       "    <path d=\"M 159.178125 106.453219 \n",
       "L 159.178125 106.134703 \n",
       "L 159.178125 25.231734 \n",
       "L 159.178125 24.913219 \n",
       "L 163.255125 24.913219 \n",
       "L 163.255125 25.231734 \n",
       "L 163.255125 106.134703 \n",
       "L 163.255125 106.453219 \n",
       "z\n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pcd4654d116\">\n",
       "   <rect height=\"111.6\" width=\"111.6\" x=\"40.603125\" y=\"9.883219\"/>\n",
       "  </clipPath>\n",
       "  <clipPath id=\"p7c654ff9ff\">\n",
       "   <rect height=\"81.54\" width=\"4.077\" x=\"159.178125\" y=\"24.913219\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 180x180 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "d2l.show_heatmaps(d2l.expand_dims(d2l.expand_dims(net.attention_weights, 0), 0),\n",
    "                  xlabel='Sorted training inputs',\n",
    "                  ylabel='Sorted testing inputs')"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Slideshow",
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  },
  "rise": {
   "autolaunch": true,
   "enable_chalkboard": true,
   "overlay": "<div class='my-top-right'><img height=80px src='http://d2l.ai/_static/logo-with-text.png'/></div><div class='my-top-left'></div>",
   "scroll": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}